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
Looking for a utility that will automatically back up a file when the file has been modified and then saved with the same file name.
Search active directory by Date Created
VB.NET - Value was either too large or too small for a Decimal Exception - Smooth Progress Meter DLL from Microsoft
How to install SQLServer Standard 2005
Insert formula to range
Need to get the guaranteed HWND on startup of a form
Why does Format([Del Date],"ww") give 53 weeks?
How do I import a text file into MS Access which appears to have verticle and hortintals breaks
Mixed 2003/2008 Environment Needs A Domain Rename
Exchange 2010 outook email client setup