Determining the default value of a column

  • I am using SQLDMO and ASP.NET to examine database tables. I would like to be able to determine if a particlar column has a default value, and perhaps, what that default value is.

    I already have a column object, how do I get the default value? For example, my dateadd field has a default value of getdate()

    Thanks

  • EXEC sp_columns @table_name = 'TableName' ,@column_name ='ColumnName'




    My Blog: http://dineshasanka.spaces.live.com/

  • It's the Text property of the DMO column object's DRIDefault property.

    --Jonathan



    --Jonathan

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

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