Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Indicate whether that column is autoincrement

Author  Topic 

DRAGON
Starting Member

13 Posts

Posted - 2006-08-21 : 01:16:54
I have a table, it haves a autoincrement column. But i dont know how to know it is autoincrement Column
Help me!
Thanks alot

dragon

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-21 : 01:30:13
sp_help 'yourTable'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-21 : 02:58:58
SELECT COLUMNPROPERTY(OBJECT_ID('MyTable'), MyColumn, 'IsIdentity')

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2006-08-21 : 04:00:37
one more..

SELECT OBJECTPROPERTY(OBJECT_ID('TableName'),'TableHasIdentity')

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2006-08-21 : 04:01:21
We are all assuming AUTOINCREMENT is IDENTITY column!

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-21 : 04:23:08
Maybe he wants to know "I know there is an IDENTITY column in my table. But which column has IDENTITY property?" ?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-21 : 04:24:04
If AUTO does not mean IDENTITY, the only thing tight know I come to think of, is a trigger.

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-08-21 : 07:05:04
Sounds like a job interview uwestion.
.

CODO ERGO SUM
Go to Top of Page
   

- Advertisement -