FAQ on Data Types in SQL Server
38. What are the data types in SQL
bigint Binary bit char cursor
datetime Decimal float image int
money Nchar ntext nvarchar real
smalldatetime Smallint smallmoney text timestamp
tinyint Varbinary Varchar uniqueidentifier
39. Difference between char and nvarchar / char and varchar data-type?
char[(n)] - Fixed-length non-Unicode character data with length of n
bytes. n must be a value from 1 through 8,000. Storage size is n
bytes. The SQL-92 synonym for char is character.
nvarchar(n) - Variable-length Unicode character data of n characters.
n must be a value from 1 through 4,000. Storage size, in bytes, is two
times the number of characters entered. The data entered can be 0
characters in length. The SQL-92 synonyms for nvarchar are national
char varying and national character varying.
varchar[(n)] - Variable-length non-Unicode character data with length
of n bytes. n must be a value from 1 through 8,000. Storage size is
the actual length in bytes of the data entered, not n bytes. The data
entered can be 0 characters in length. The SQL-92 synonyms for varchar
are char varying or character varying.
40. GUID datasize?
128bit
41. How GUID becoming unique across machines?
To ensure uniqueness across machines, the ID of the network card is
used (among others) to compute the number.
42. What is the difference between text and image data type?
Text and image. Use text for character data if you need to store more
than 255 characters in SQL Server 6.5, or more than 8000 in SQL Server
7.0. Use image for binary large objects (BLOBs) such as digital
images. With text and image data types, the data is not stored in the
row, so the limit of the page size does not apply.All that is stored
in the row is a pointer to the database pages that contain the
data.Individual text, ntext, and image values can be a maximum of
2-GB, which is too long to store in a single data row.
For More SQL SERVER Frequently Asked Interview Questions
No comments:
Post a Comment