Get identity and default values from system tables

  • Hi all,

    I am creating a vb.net program to update a database schema.

    The databases will be SQL Server 2000 based and the update will be based on information in the system tables.

    I'm sure I will run into many problems but the first two are as follows.

    1. I need to know the identity seed and identity increment values of a column.

    2. How do I get the default value of a column (if it has a default value).

    Any help would be greatly appreciated.

    Thanks.

  • this is for default value

    SELECT cdefault FROM syscolumns

    and identity

    @@Ident_Current ('TableName')

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

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