dbTalk Databases Forums  

IDENTITY_INSERT problem...

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss IDENTITY_INSERT problem... in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Matthew Wells
 
Posts: n/a

Default IDENTITY_INSERT problem... - 11-05-2007 , 08:05 PM






Hello,

I have set the IDENTITY_INSERT on a table to ON. To test this, I tried
to set it on another table and got the message that it was already on the
table I want. But every time I try to insert records, it keeps telling me
the IDENTITY_INSERT is off!!!

Anyone know why?

Thanks.

Matthew Wells
Matthew.Wells (AT) FirstByte (DOT) net



Reply With Quote
  #2  
Old   
Greg D. Moore \(Strider\)
 
Posts: n/a

Default Re: IDENTITY_INSERT problem... - 11-05-2007 , 09:06 PM






"Matthew Wells" <Matthew.Wells (AT) FirstByte (DOT) net> wrote

Quote:
Hello,

I have set the IDENTITY_INSERT on a table to ON. To test this, I tried
to set it on another table and got the message that it was already on the
table I want. But every time I try to insert records, it keeps telling me
the IDENTITY_INSERT is off!!!

You can only enable IDENTITY_INSERT on one table at a time. Sounds like
you're trying to do it on two tables at once.


Quote:
Anyone know why?

Thanks.

Matthew Wells
Matthew.Wells (AT) FirstByte (DOT) net




--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html




Reply With Quote
  #3  
Old   
Matthew Wells
 
Posts: n/a

Default Re: IDENTITY_INSERT problem... - 11-05-2007 , 10:36 PM



I said "To test this, I tried to set it on another table and got the
message that it was already on the table I want" meaning that I confirmed
that it was set on the table I wanted.

This one is really stumping us. I've googled all night!!!



"Greg D. Moore (Strider)" <mooregr_deleteth1s (AT) greenms (DOT) com> wrote

Quote:
"Matthew Wells" <Matthew.Wells (AT) FirstByte (DOT) net> wrote in message
news:BKudndSpqbutUbLanZ2dnUVZ_tijnZ2d (AT) comcast (DOT) com...
Hello,

I have set the IDENTITY_INSERT on a table to ON. To test this, I
tried to set it on another table and got the message that it was already
on the table I want. But every time I try to insert records, it keeps
telling me the IDENTITY_INSERT is off!!!


You can only enable IDENTITY_INSERT on one table at a time. Sounds like
you're trying to do it on two tables at once.


Anyone know why?

Thanks.

Matthew Wells
Matthew.Wells (AT) FirstByte (DOT) net





--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com
http://www.greenms.com/sqlserver.html





Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: IDENTITY_INSERT problem... - 11-06-2007 , 01:57 AM



Matthew Wells (Matthew.Wells (AT) FirstByte (DOT) net) writes:
Quote:
I have set the IDENTITY_INSERT on a table to ON. To test this, I tried
to set it on another table and got the message that it was already on the
table I want. But every time I try to insert records, it keeps telling me
the IDENTITY_INSERT is off!!!

Anyone know why?
Why do you use IDENTITY in the first place, if you want to insert explicit
values?

Maybe you could post a script that demonstrates your issue. Else we have to
guess what you are doing.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.