Jim Work


INSERT INTO dbo.my_table (table_key)
VALUES (007)

-- Msg 544, Level 16, State 1, Line 1
-- Cannot insert explicit value for identity column in table 'my_table' when IDENTITY_INSERT is set to OFF.



SET IDENTITY_INSERT dbo.my_table ON
INSERT INTO dbo.my_table(table_key)
VALUES (007)
SET IDENTITY_INSERT dbo.my_table OFF

-- Msg 1088, Level 16, State 11, Line 2
-- Cannot find the object "dbo.my_table" because it does not exist or you do not have permissions.

I know for certain that I have read/write permissions on this server. Is this somehow restricted to only the dba or something

I appreciate all of this community's help with my basically non-stop flow of questions. You're a huge chunk of help, and it's deeply appreciated!!

Jim Work




Re: IDENTITY_INSERT Issue

Phil Brammer


You should search Books On-Line for that command you are trying to run.

Default permissions for that command (SET IDENTITY_INSERT) are set to the sysadmin role.

Below is for SQL 2000, but I imagine the same is said for 2005. (BOL doesn't seem to be working too well for me at the moment.)

http://msdn2.microsoft.com/en-us/library/aa259221(SQL.80).aspx








Re: IDENTITY_INSERT Issue

Phil Brammer

Oh, and for future reference, you should post this in the Transact-SQL forum.






Re: IDENTITY_INSERT Issue

Jim Work

Thanks!

Oh! Sorry about posting in the wrong forum!!

Cheers!

Jim Work