Can not turn ENTITY_INSERT Table ON.

  • Hi,

    I tried to execute in SQL Server 2005 Query Analyzer the following statement:

    SET IDENTITY_INSERT MyTable ON

    insert into MyTable values(3508,'06/07/2009')

    AND GOT ERROR:Msg 8101,....

    The first column is IDENTITY column.

    How to get permission to execute this statement or set identity on?

  • you must explicitly identify the column names, especial when identity_insert is on:

    SET IDENTITY_INSERT MyTable ON

    insert into MyTable(ColumnId,ColumnDate) values(3508,'06/07/2009')

    zubamark (6/19/2009)


    Hi,

    I tried to execute in SQL Server 2005 Query Analyzer the following statement:

    SET IDENTITY_INSERT MyTable ON

    insert into MyTable values(3508,'06/07/2009')

    AND GOT ERROR:Msg 8101,....

    The first column is IDENTITY column.

    How to get permission to execute this statement or set identity on?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Wow! Thanks a lot. It works.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply