February 26, 2004 at 1:45 pm
Hi,
how to give default value to a existing column in table.
example.
create table rr(s varchar(1) null)
now i like to add default value to s column. i tried following.
alter table rr alter column s varchar(1) default 'N'
but it is giving syntax is wrong.
thanx
February 26, 2004 at 1:57 pm
Lookup CREATE DEFAULT
and sp_bindefault
February 26, 2004 at 2:53 pm
Alter Table rr
ADD CONSTRAINT DF_rr_s DEFAULT 'N' FOR s
* Noel
February 27, 2004 at 2:39 am
create table rr(s varchar(1) null)
varchar(1) ???
This is only an example, right? If not, you should change it to char.
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply