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 |
|
agarwasa2008
Posting Yak Master
109 Posts |
Posted - 2009-10-20 : 13:23:11
|
| Hi,I am trying to insert some rows into an existing table. The PK which is prdouctID has consecutive numbers starting at 1. It is currently on 151 for example Since I will be inserting rows what do I do for this particular column so that the productId for the inserted row gets 152 now.Thanks,SA |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-10-20 : 13:46:20
|
| use this to check if its an identity column. it should be 1 for identitySELECT COLUMNPROPERTY( OBJECT_ID('table name here'),'productID','IsIdentity') |
 |
|
|
agarwasa2008
Posting Yak Master
109 Posts |
Posted - 2009-10-20 : 13:54:09
|
| Thank you to both of you. Brilliant. I will have to save this in my special file for future reference. Visakh I do get a 1 when I excute your IsIdentity statement. It feels like magic.SA |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-10-20 : 13:57:22
|
| Welcome...that does tell that its an identity column. So you may use earlier suggestion |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|