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
 Transact-SQL (2000)
 How to know which column is IDENTITY?

Author  Topic 

VoiCoi
Starting Member

2 Posts

Posted - 2005-04-12 : 23:38:38
Hi,

When use sp_columns to view table's column information, IDENTITY column appeared as "int identity", "smallint identity"... it's inconsistent, how can I get IDENTITY column in more consistent way, e.g. a IsIdentity column in result set?

Thank you,

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-04-12 : 23:40:57
Take a look at the COLUMNPROPERTY function in Books Online.

And there's nothing inconsistent about the output, "int" and "smallint" indicate the datatype used for that column.
Go to Top of Page

VoiCoi
Starting Member

2 Posts

Posted - 2005-04-13 : 01:11:09
nothing inconsistent?

why not simple that "int", "smallint", "bigint".... as data type names and seperate IsIdentity property instead of duplicate of "int" and "int identity" and so on?
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2005-04-13 : 01:32:17
Thanks for the help Rob. Appreciate it.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-04-13 : 07:15:15
You're welcome Derrick. Glad someone does.
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2005-04-13 : 10:44:48
*cracks whip*

Git to answering more questions Rob!!!

;)
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-04-13 : 11:43:28
"why not simple that "int", "smallint", "bigint".... as data type names and seperate IsIdentity property instead of duplicate of "int" and "int identity" and so on?"

TALK TO M$...I'm sure they'll take your point on board.
Go to Top of Page
   

- Advertisement -