By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,968 Members | 1,681 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,968 IT Pros & Developers. It's quick & easy.

Default constraint not working

Seth Schrock
Expert 2.5K+
P: 2,951
I have three bit fields in a table that I have set to NOT NULL so that I can link to the table from MS Access. On each of these three fields, I have setup default constraints to set the value to False (0). This has been working for over a year now. All of a sudden, they have stopped working and every time I try to add a record to this table through MS Access, I get an error message that says Cannot insert the value NULL into column 'AppraisalRequested', table 'LoanTracking.dbo.tblAppraisals'; column does not allow nulls. INSERT fails (#515) I have tried removing and re-adding the constraint to the field and that doesn't change anything. Here is the script I used to add the constraint:
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE [dbo].[tblAppraisals] ADD  CONSTRAINT [DF_tblAppraisals_AppraisalRequested]  DEFAULT ((0)) FOR [AppraisalRequested]
  2. GO
I'm using SQL Server 2005 currently.
Nov 13 '14 #1
Share this Question
Share on Google+
2 Replies

P: 10
Did you upgrade database server/driver or installed multiple versions ?
Nov 20 '14 #2

Seth Schrock
Expert 2.5K+
P: 2,951
No, there was changes made. No restore from backup, no server updates, etc.
Nov 20 '14 #3

Post your reply

Sign in to post your reply or Sign up for a free account.