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)
 Default Values on SQL Table Fields

Author  Topic 

Looper
Yak Posting Veteran

68 Posts

Posted - 2009-10-12 : 12:08:16
Hi, I have a few questions regarding default values set up on sql tables.

1.If a field e.g. FieldA has a default constraint set up with value of N set up and the table has lots of row then set up with N. If I where to change the constraint to the value X, would all the rows with N set up already change to X?

2.Do default constraints only work on new rows(inserts) into a table. For example if I updated fieldB and fieldA was set up with Null, but the default constraint says to set fieldA to N, would fieldA become N on the table update for FieldB.

Hope this is understandable.

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-10-12 : 12:15:40
I would have a test with a simple testtable to answer this question - so can you.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -