Have you ever been asked by your colleague anytime to tell you what are the different columns present in a particular sql table, what is the datatype of each column, whether its a nullable or not nullable column so on and so forth ?
Well to go and find out that database table in SSMS and expand the columns node and getting the details should be the last resort. Instead you can make use of INFORMATION_SCHEMA to pull out the details by writing simple query.
INFORMATION_SCHEMA in sql is one of the lesser used methods in sql by developers. It is mostly used by DBA.
Here is a quick tip on how to use in INFORMATION_SCHEMA effectively.
Try running this query in SSMS
— Returns all the columns, its datatype, is nullable or not, what is the max length etc
WHERE TABLE_NAME = N’YOURTABLENAME‘
— Get the name/count of tables present in your database
NOTE: For further reading http://msdn.microsoft.com/en-IN/library/ms186778.aspx