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 2000 Forums
 Transact-SQL (2000)
 how to set default value to column

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2006-08-14 : 06:00:20
I ahve one table test with column Payment
I want to assign a default value 'N' to this column.
How i can assign this value to column using ALTER query.

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-08-14 : 06:17:19
Somthing like this


ALTER TABLE dbo.Test ADD CONSTRAINT
DF_Test_Col1 DEFAULT 'N' FOR Col1


Replace Col1 by your column name

Chirag
Go to Top of Page

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-08-14 : 08:30:09
Or for any similar u can refer BOL

In BOL, check for "Alter table" in Index
The Point E gives the similar example(s).

Srinika
Go to Top of Page
   

- Advertisement -