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.
| Author |
Topic |
|
hendrasd
Starting Member
20 Posts |
Posted - 2003-04-01 : 01:45:23
|
| Is there any procedures in SQL Server 2000 to find an identity column as primary key ?-- Never stop learning -- |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2003-04-01 : 03:36:06
|
| declare @tblname varchar(128)select @tblName = 'ss'select c.namefrom syscolumns c, INFORMATION_SCHEMA.TABLE_CONSTRAINTS i, INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE icwhere c.id = object_id(@tblname)and i.TABLE_NAME = @tblnameand ic.TABLE_NAME = @tblnameand i.CONSTRAINT_TYPE = 'PRIMARY KEY'and i.CONSTRAINT_NAME = ic.CONSTRAINT_NAMEand ic.COLUMN_NAME = c.name==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|