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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Creating a default value on NULL Column

Author  Topic 

sudha12345
Starting Member

47 Posts

Posted - 2009-06-19 : 01:11:29
I has a table which has the column IS_DELETED and it accepts NULL Value

i has to create to default value N on that indicating Not Deleted


Can any one say how can we do that

Sudhakar

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-19 : 02:10:28
ALTER TABLE your_table ADD CONSTRAINT
DF_IS_DELETED DEFAULT 'N' FOR IS_DELETED

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-06-20 : 08:14:56
see this link for default constraints
http://www.mssqltips.com/tip.asp?tip=1425
Go to Top of Page
   

- Advertisement -