Check of Identity

  • In a stored procedure i want to check the table has got identity or not ,Plz suggest how can i do that.

  • quote:


    In a stored procedure i want to check the table has got identity or not ,Plz suggest how can i do that.


    what about

    
    
    SELECT OBJECTPROPERTY(OBJECT_ID('<your_table>'),'TableHasIdentity')

    ?

    If it returns 1, the table has an Identity, 0 indicates no Identity

    Frank

    http://www.insidesql.de

    Edited by - Frank Kalis on 10/10/2003 12:42:50 AM

    Edited by - Frank Kalis on 10/10/2003 12:43:36 AM

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

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

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