Rabu, 17 November 2010

List all Default Values in a SQL Server Database

I had earlier written a query to Find a Column Default value using T-SQL. Here’s how to find the default value of all columns in all tables of a databaseSELECT obj.name as 'Table', col.name as 'Column', object_definition(default_object_id) AS [DefaultValue]FROM   sys.objects obj INNER JOIN sys.columns colON obj.object_id = col.object_idwhere obj.type = 'U'The sys.objects and sys.columns provides

Tidak ada komentar:

Posting Komentar