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 |
matkwan
Starting Member
36 Posts |
Posted - 2007-05-10 : 04:01:35
|
Hi,Before I run this:"ALTER TABLE [dbo].[ttClass] ADD DEFAULT (1) FOR [LearningAreaID]"I would like to check if the default has already set to that column.Any idea how?Matt |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-10 : 04:05:03
|
[code]If Exists(select * from information_schema.columns where table_name = 'ttClass' and column_name = 'LearningAreaID' and Table_schema = 'dbo'and column_default is NULL)ALTER TABLE [dbo].[ttClass] ADD DEFAULT (1) FOR [LearningAreaID]GO[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|