SQL SERVER

  • I want to know the syntax to set the Identity of a column to OFF. Actually I am trying to truncate the table but that doesnt happen coz of the Identity.

    I know how ro turn it OFF from the table structure UI wise. But I need the correct syntax.

    Please Help ASAP:-)!!!!

  • Identity doesn’t prevent you from truncating a table. There are other things that can prevent table from being truncated (for example – permissions problem, table is referenced by another table, etc’). Identity can’t be shut off. It can be ignored at a specific session, but the rest of the sessions can still work with the identity column the regular way.

    If you want to know how to insert your own value into an identity column read in BOL (the help file that comes with SQL Server) about “set identity_insert”. If you want to know how to modify the seed of an identity column read in BOL about dbcc checkident.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Thanks a lot for the Help...

    This was quite a Learning for ME 🙂

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

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