Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: Monday, March 10, 2014 5:18 AM
Points: 5, Visits: 10
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 @ 2:44 PM
Points: 42,443, Visits: 35,498
Define 'not working'?

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



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
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: Today @ 12:12 PM
Points: 15,517, Visits: 27,896
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 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
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 @ 7:40 PM
Points: 12,880, Visits: 31,802
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1532988
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse