Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a way to generate PK values for Identity off

Status
Not open for further replies.

hvisionexpo

Programmer
Apr 19, 2005
43
US
is there a way to generate PK values for Identity off.

I have PK column that is set to IDENTITY OFF and I want to insert rows using SQL. I was wondering if there was still a way to generate PK automatically.
 
It depends on what you mean automatically. Identity columns will do that for you. If you want another type of PK, then you will have to generate it with some sort of algorithm. You can create a column of type UniqueIdentifier and set the default value to NewID().

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top