I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL.
Results would be something like:
TableName, ColumnName
I want to create a list of columns in SQL Server 2005 that have identity columns and their corresponding table in T-SQL.
Results would be something like:
TableName, ColumnName
List of tables without Identity column based on Guillermo answer:
here's a working version for MSSQL 2000. I've modified the 2005 code found here: http://sqlfool.com/2011/01/identity-columns-are-you-nearing-the-limits/
This worked for me using Sql Server 2008:
Use this :
Another way (for 2000 / 2005/2012/2014):
NOTE:
table_name_here
should beschema.table
, unless the schema isdbo
.In SQL 2005: