Thursday, August 29, 2013

Getting list of tables with Identity Columns



SELECT t.name AS [Table_Name], c.name AS [Column_Name],
tp.name AS [Data_Type],c.max_length AS [Size]
FROM sys.tables t JOIN sys.columns c
ON t.object_id = c.object_id
JOIN sys.types tp ON c.system_type_id = tp.system_type_id
WHERE c.is_identity = 1





Even arbi's solution will work.



Regards, Deven ----------------------------------------- Please vote if you find any of my post helpful.

No comments:

Post a Comment