Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
marginerazvan
Starting Member
14 Posts |
Posted - 2007-11-12 : 07:32:45
|
| I want to make a query that should list some informations about the columns that have defaults.name of default constraintname of the columnname of the tablevalue of default constraintI cannot managed to know the last part (value of default constraint)Here is what I did until now:select sysobjects.name, syscolumns.name, sysobjects_1.name from (sysobjects INNER JOIN sysobjects AS sysobjects_1 ON sysobjects.parent_obj = sysobjects_1.id)inner join syscolumns on sysobjects.id = syscolumns.cdefault where sysobjects.xtype = 'D' and sysobjects_1.xtype = 'U'Can you help me finding the exact VALUE of the default constraint?Ex.table name = OFFER_ARTICLEScolumn name = PIECESdefault name = DF_PIECESdefault value = 10 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-12 : 07:50:59
|
| select column_name from INFORMATION_SCHEMA.COLUMNS where column_default='((10))'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|