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
 General SQL Server Forums
 New to SQL Server Programming
 setting default value

Author  Topic 

sujeethbala2110
Starting Member

29 Posts

Posted - 2007-01-08 : 05:55:00
hi

i have to add a column of date datatype and i want to set the default value to getdate(). how to do this using sql script.

thanks

suji

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-08 : 06:20:28
[code]Alter Table tbl1
Add datecol datetime Default(getdate())[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -