Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MS SQL Server Interview Question:
What Are Character String Data Types in MS SQL Server?
Submitted by: AdministratorCharacter string data types are used to store code page based character strings. SQL Server 2005 supports the following character string data types:
* CHAR - Code page based character strings with a fixed length of n bytes defined as CHAR(n). The maximum length is 8,000 bytes. CHAR has a synonym of CHARACTER.
* VARCHAR - Code page based character strings with a variable length of n bytes defined as VARCHAR(n). The maximum length is 8,000 bytes. VARCHAR has two synonyms of CHAR VARYING and CHARACTER VARYING. VARCHAR also has special form as VARCHAR(MAX), which can store up to 2^31-1 bytes.
* TEXT - Code page based character strings with a variable length up to 2^31-1 (2,147,483,647) bytes. TEXT is equivalent to VARCHAR(MAX).
Here are some good examples of character string values:
PRINT 'Hello! '; -- CHAR(10)
PRINT 'Hello!'; -- VARCHAR(10)
GO
Submitted by: Administrator
* CHAR - Code page based character strings with a fixed length of n bytes defined as CHAR(n). The maximum length is 8,000 bytes. CHAR has a synonym of CHARACTER.
* VARCHAR - Code page based character strings with a variable length of n bytes defined as VARCHAR(n). The maximum length is 8,000 bytes. VARCHAR has two synonyms of CHAR VARYING and CHARACTER VARYING. VARCHAR also has special form as VARCHAR(MAX), which can store up to 2^31-1 bytes.
* TEXT - Code page based character strings with a variable length up to 2^31-1 (2,147,483,647) bytes. TEXT is equivalent to VARCHAR(MAX).
Here are some good examples of character string values:
PRINT 'Hello! '; -- CHAR(10)
PRINT 'Hello!'; -- VARCHAR(10)
GO
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.