Microsoft
Software
Hardware
Network
Question : SQL Query question
I have two columns (ColA, ColB) in a table (Table1) that must fulfil
certain combination of values. How can I stop SQL query to execute if
the query tries to update or insert an invalid combination of values?
Example:
if Table1.ColA equals 'ABC' then Table1.ColB must be equal 'XYZ'.
An update query should fail similar to the check constraint and
the data remains as it is. An insert query should fail as well
and the table will not have an extra invalid record.
Answer : SQL Query question
Create a check constraint on the table, with the condition in the Check
Here's a sample
alter table products add constraint ck_product check (len(Name) > len(FamilyCode))
Random Solutions
Citrix XenApp 5 Installation General Question
Can't access variable in code behind page
In between Asterisk BLF
Anyone run an online backup software along side Ghost with no conflicts.
How do I get my emails off an Outlook.ost file to a outlook.pst file?
How do I hide/show divs in a custom (ascx) control inside an asp:repeater control?
Getting an operation failed error when logging into the Plesk Panel
Remote access VPN via Thompson TG585 v7
Disable IMAP service in Exchange 2010 Certificate?!
Can I make an iPhone operational "without SIM" card (very good reason to-read please)?