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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Solved ...IDENTITY_INSERT is set to OFF

Author  Topic 

Gekko
Yak Posting Veteran

63 Posts

Posted - 2012-01-24 : 06:10:58
hallo

I was looking for a problem in history forum..but not
before import data
insert into tabkon (id, idorg, spojeni) values (2,76567,'marcelo@gmail.com')
I wrote Set Identity_insert tabkon ON
a get follow msg.
Cannot insert explicit value for identity column in table 'TabKon' when IDENTITY_INSERT is set to OFF.

Why...I am wrote Identity_insert tabkon ON

where is problem, please...

thanks

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2012-01-24 : 06:48:31
Check whether you are using correct DB/Schema/Object

Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-01-24 : 06:49:19
Set Identity_insert tabkon ON
Cannot insert explicit value for identity column in table 'TabKontakty'

Do you see the difference?

Your post isn't showing us what you are really doing...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Gekko
Yak Posting Veteran

63 Posts

Posted - 2012-01-24 : 07:36:53
oh yeah !! mistake

TabKon it is
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-01-24 : 07:49:51
Tell us more...
Which way you are using to import data?
Did you try the SET command itself to see if there is an error?
Are SET command and data import in different sessions?

We cannot see what you are doing so please tell us more...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Gekko
Yak Posting Veteran

63 Posts

Posted - 2012-01-24 : 07:53:34
quote:
Originally posted by senthil_nagore

Check whether you are using correct DB/Schema/Object



its the same there is no mistake
i dont know what else
Go to Top of Page

Gekko
Yak Posting Veteran

63 Posts

Posted - 2012-01-24 : 08:01:24
quote:
Originally posted by webfred

Tell us more...
We cannot see what you are doing so please tell us more...


open sql manag.studio
1. identifies the DB (DBcompany)- click left from list DB
2. click NEW QUERY
3. I write:
Set Identity_insert tabkon ON
EXECUTE
insert into tabkon (id, idorg, spojeni) values (2,76567,'marcelo@gmail.com')
EXECUTE
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2012-01-24 : 08:14:02
You still getting the same message, or is the message telling you that Identity_insert is already set on a DIFFERENT table ? (in which case you have to turn that OFF before you can turn it ON for the next table).
Go to Top of Page

Gekko
Yak Posting Veteran

63 Posts

Posted - 2012-01-24 : 09:11:47
OK !!! it is good
Kristen:
I will try to turn that OFF before I can turn it ON for the next table

and it's good

big thanks all
Go to Top of Page
   

- Advertisement -