SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 DEFAULT CONSTRAINT not working
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

yosiasz
Flowing Fount of Yak Knowledge

USA
1635 Posts

Posted - 02/22/2013 :  20:41:25  Show Profile  Click to see yosiasz's MSN Messenger address  Reply with Quote
Greetings

Ever come across this? I created a default constraint on ModifyDate and ModifyBy
When doing an update on a row the values of these column do not change. They are both nullable columns, it is something I have inherited and am unable to change the embedded oogly code on the site.

Not sure why the constraint are not doind what I was hoping to do when site calls UPDATE table set x = 0
Thanks

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion

khtan
In (Som, Ni, Yak)

Singapore
17642 Posts

Posted - 02/22/2013 :  20:48:13  Show Profile  Reply with Quote
default constraint only take effect on INSERT statement. Not UPDATE


KH
Time is always against us

Go to Top of Page

yosiasz
Flowing Fount of Yak Knowledge

USA
1635 Posts

Posted - 02/22/2013 :  20:51:17  Show Profile  Click to see yosiasz's MSN Messenger address  Reply with Quote
are you serious!!!!!!?!? u learn something new all the time.

THanks Khtan!

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17642 Posts

Posted - 02/22/2013 :  21:02:05  Show Profile  Reply with Quote
http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx

if you want to handle the UPDATE, you need to use update trigger


KH
Time is always against us


Edited by - khtan on 02/22/2013 21:03:02
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000