SQL SERVER INTERVIEW QUESTION & ANSWERS
Databases
Follow Us
TAGS
36. | What is the difference between BYNARY and VARBINARY? |
---|---|
BYNARY: Fixed storage of binary characters using 1 byte per character + 2 bytes total overhead up to 8,000 characters. VARBINARY :Variable storage of binary characters using 1 byte per character + 2 bytes total overhead up to 8,000 characters. Up to 2GB storage when used as varbinary(max). |
37. | Explain sql_variant. |
---|---|
Can store a value of any datatype except:
|
38. | What statement do you use to create User-Defined Datatype? |
---|---|
CREATE TYPE dbo.mytype FROM char(2) NOT NULL |
39. | Tell me the Declaration and Deletion statement for User-Defined Datatype. |
---|---|
DECLARE @stateval mytype DROP TYPE dbo.mytype |
40. | What is statement do you use to display a list of all databases? |
---|---|
SELECT DB_NAME(database_id) AS dbname, type_desc, name, LEFT(physical_name, 2) AS DriveLetter FROM sys.master_files |