Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

problem with default constraint Expand / Collapse
Author
Message
Posted Tuesday, January 21, 2014 2:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, April 12, 2015 10:56 PM
Points: 5, Visits: 11
hi everyone here my problem is that if we have used default constraint with table so it not working so plz tell me any exaple of default constraint
thank you......
Post #1532917
Posted Tuesday, January 21, 2014 2:40 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 12:44 PM
Points: 45,297, Visits: 43,512
Define 'not working'?

What exactly did you do? What behaviour are you expecting? what are you seeing?



Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1532920
Posted Tuesday, January 21, 2014 3:39 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: 2 days ago @ 12:32 PM
Points: 16,950, Visits: 31,767
Please supply a bunch more detail, especially the code you wrote and what you expected it to do for you.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1532939
Posted Tuesday, January 21, 2014 5:40 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 4:36 PM
Points: 14,468, Visits: 38,067
even if you have a default constraint in place, if you have a data access layer that explicitly sends NULL to be the column value, then NULL it shall be.
defaults are only used when a value is not provided.

As others have mentioned, more details will get you some better answers, but that was the first thing i thought of when i read "default not working"


Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Post #1532988
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse