November 22, 2004 at 9:30 am
Hi all, I need help setting up a check constraint. When someone enters a machinenumber into tableA, it must exist in the machines table. So TableA.machinenumber must exist in tableB. I'm not sure if this could be done as a constraint, or if it needs to be a trigger? Thanks in advance for any help.
Al
November 22, 2004 at 11:25 am
Use a foreign Key Constraint with a NOT Null option on the column
HTH
* Noel
November 22, 2004 at 11:31 am
Sorry, I should have mentioned, I have a DTS package that drops and re-creates the machinestable, so if I have a FK constraint, won't I get an error when running my DTS when it tries to drop the table?
November 22, 2004 at 12:25 pm
If you DROP and recreate the table Yes of course you will get the error but in that case you could DISABLE the Constraint do your stuff and Re enable it ![]()
HTH
* Noel
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply