Solved

Need alter constraint syntax for check constraint

Posted on 2001-07-27
2
723 Views
Last Modified: 2009-12-16

I can't get this thing to work.  I have added a new condition 'Billing Maintenance' and need to recompile the contraint.  Do I have to drop it and add it?  Do I need to drop the table and recreate it with the new value?  It looks like all you can do with a alter constraint is turn it on and off.   How do I do this.

ALTER TABLE ctms.requesttyperef MODIFY CONSTRAINT ck_requestflag
IN('Billing Maintenance','Deploy','Redeploy','Account Maintenance',
'Account Service','Supplies Maintenance', 'Third Party Equipment Billing'
,'Do Not Process','Customer Owned Services','Deploy Peripherals',
'Leasing Services','Convert','Internet Services','Salesperson Deploy'
,'Front End Conversion');
0
Comment
Question by:DonFreeman
2 Comments
 
LVL 1

Expert Comment

by:leolkk
Comment Utility
If there are NEW values,
1) i am used to drop the "CONSTRAINT" first.
2) after updating corresponding data. I will then add a new constraint.

If there is NO new values,
1) I turn it off
2) update data
3) turn it on again
0
 
LVL 5

Accepted Solution

by:
ser6398 earned 50 total points
Comment Utility
Try the following:

ALTER TABLE ctms.requesttyperef MODIFY CONSTRAINT ck_requestflag CHECK (requestflag IN ('Billing Maintenance','Deploy','Redeploy','Account Maintenance', 'Account Service','Supplies Maintenance', 'Third Party Equipment Billing', 'Do Not Process','Customer Owned Services','Deploy Peripherals',
'Leasing Services','Convert','Internet Services','Salesperson Deploy', 'Front End Conversion'));
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now