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 |
pooya1072
Starting Member
13 Posts |
Posted - 2013-05-28 : 11:14:39
|
hi friendsi want to add a column to a table with conditions below :1- it has a default value=02- this column can get null value3- no constraint should be createdis it possible ?thanks |
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2013-05-28 : 13:56:39
|
Individual point explanation: 1) you can set default e.g. create table testing (col int default 0,col2 int) 2) yes it can get nul values 3) when you say default value=0, that means you're defining a constraint. Overall: the asnwer to "is it possbile" is No, if you want all three points in one table. Since constraint would be created when you define a default value for a column.CheersMIK |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-05-28 : 14:25:36
|
ut can still get null value if you've not explicitly made it not nullable in definition and passed an explicit NULL in the insert------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
|
|
|