Insert Value into table

  • Hi,

    How to insert a value into a table which is having only one column of identity type by using a SQL query " Insert into "

  • Hi,

    You should consider you database design why you are using the one column table having the identity field.

    You should make the entry into the table by Making the Identity Insert ON/OFF.

    for this you can use

    SET IDENTITY_INSERT YourTableName ON

    INSERT INTO products (id) VALUES(3)

    SET IDENTITY_INSERT YourTableName OFF

    Cheers

    cheers

  •  

    Hi,

    You should consider you database design why you are using the one column table having the identity field.

    You should make the entry into the table by Making the Identity Insert ON/OFF.

    for this you can use

    SET IDENTITY_INSERT YourTableName ON

    INSERT INTO YourTableName (id) VALUES(3)

    SET IDENTITY_INSERT YourTableName OFF

    Cheers


    Kindest Regards,

    cheers

  • i agree with rao, why would you want a one column table. reconsider your db design or you can post your requirement to see if we can help


    Everything you can imagine is real.

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

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