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!

IDENTITY_INSERT not working

Status
Not open for further replies.

iminore

Programmer
Sep 3, 2002
50
GB
I'm running this in ASP:

objConn.Execute("set identity_insert Keywords on")
objConn.Execute("insert into Keywords (keywordid,keyword) values(1,'abc')")

I keep getting the message that identity_insert is not set on for table. I see references to dbo qualification in related views and SPs being a potential problem, but I've removed them.

Any ideas?
 
objConn.Execute("set identity_insert Keywords on insert into Keywords (keywordid,keyword) values(1,'abc')")

try the above
i've not tried this from VB, but i had a similar problem using dynamic sql. basically (in dynamic sql at any rate) it's to do with the identity_insert command being executed by a different connection to the insert command, so the insert command can't "see" that identity_insert has been set to on

hope this helps
LFCfan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top