Microsoft
Software
Hardware
Network
Question : Referential Integrity and Constraint Question
Hi,
I have two tables, "Customer" and "Inactive"
Customer Table
cust_id (PK) cust_name status
1 ABC Company 0
4 XYG Company 2
Status Table
status(PK) status_desc
0 some desc
1 diff desc
2 2nd desc
I want to create a constraint between the PK of the Status table and the Status column in the Customer table. What would be the SQL needed to do this?
I basically want to prevent a user from creating a record in the Customer Table with a value in the status column that doesn't exist in the Status table.
Hope that makes sense.
-ws
Answer : Referential Integrity and Constraint Question
ALTER TABLE Customer ADD FOREIGN KEY (status) REFERENCES Status(status)
Random Solutions
C# -- "Value==null"
Automatically create separate tables from an SQL table defined by field value
WCF Question
In database mirroring. connection problem to failover partner when original principal is disconnectet
I have the total amount of sales for the month, but I need to split commission between 3 Areas.
"Error 1327 Invalid Drive F:/" on Sprint USB Wireless Installation
Upgrade from MSSQL 2005 Express to MSSQL 2008 Standard
How to add to TabControl from other thread?
Run-time error '2450'. Microsoft Access can't find form 'frmTenants'
Assigning text, linked to cells ,inside a text box