469,645 Members | 1,241 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Question on Idenity Columns

Is there a way to query any system tables, like sysobjects, for User tables
with Identity columns?
We have a SQL2000 server that we want to replicate. One of my tasks is to
identify all tables with Identity columns that are missing the 'not for
replication' clause.

Thanks,

JoeyD
Jul 23 '05 #1
2 1041
JoeyD (jo*****@yahoo.com) writes:
Is there a way to query any system tables, like sysobjects, for User
tables with Identity columns? We have a SQL2000 server that we want to
replicate. One of my tasks is to identify all tables with Identity
columns that are missing the 'not for replication' clause.


SELECT object_name(id), name
FROM syscolumns
WHERE columnproperty(id, name, 'IsIdentity') = 1
AND columnproperty(id, name, 'IsIdNotForRepl') = 1


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
Erland - Thank you for your reply.

JoeyD
"Erland Sommarskog" <es****@sommarskog.se> wrote in message
news:Xn*********************@127.0.0.1...
JoeyD (jo*****@yahoo.com) writes:
Is there a way to query any system tables, like sysobjects, for User
tables with Identity columns? We have a SQL2000 server that we want to
replicate. One of my tasks is to identify all tables with Identity
columns that are missing the 'not for replication' clause.


SELECT object_name(id), name
FROM syscolumns
WHERE columnproperty(id, name, 'IsIdentity') = 1
AND columnproperty(id, name, 'IsIdNotForRepl') = 1


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by VB Programmer | last post: by
7 posts views Thread by Joe Fallon | last post: by
1 post views Thread by =?Utf-8?B?THluYkBtcy5jb20=?= | last post: by
7 posts views Thread by bobh | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.