Finding and listing all columns in a SQL Server database with identity I wanted to RESEED all the identity columns in that database, so I need to create a script so I can find out which column in which table has the identity property.
Using the script from the Question as a starting point, you might be better off using the following query:

SELECT
  N'DBCC CHECKIDENT (''' +
  SCHEMA_NAME(tbl.[schema_id]) +
  N'.' +
  tbl.name +
  N''', RESEED); -- WITH NO_INFOMSGS;'
   , clmn.seed_value
   , clmn.increment_value
   , clmn.last_value
FROM       sys.tables tbl 
INNER JOIN sys.identity_columns clmn
        ON clmn.[object_id] = tbl.[object_id]
WHERE  tbl.[object_id] &lt;&gt; OBJECT_ID(N'dbo.sysdiagrams') -- skip "dbo.sysdiagrams"
ORDER BY SCHEMA_NAME(tbl.[schema_id]), tbl.name;


The main difference is rather than determining the IDENTITY field by matching the column name found in sys.identity_columns, this query replaces the JOIN to sys.columns with sys.identity_columns and removes it from the WHERE clause. The effect of this is to implicitly filter the rows (since only tables with IDENTITY columns would be in sys.identity_columns) and to now have access to the IDENTITY meta-data: seed_value, increment_value, and last_value.

Matching on the column name only, you run the risk of selecting tables that might not have an IDENTITY column but do have a column that has the same name as one of the columns found in sys.identity_columns.