Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
julianfraser
Starting Member
19 Posts |
Posted - 2004-07-11 : 10:45:45
|
| I need a work-around for this as SQL Server tells me that you cannot include subqueries in CHECK contraints and I'm not sure of the best way.ALTER TABLE at_credit_transactionADD CONSTRAINT CN_credit_transaction_formatCHECK (transaction_typeID IN (SELECT transaction_typeID FROM at_transaction_type WHERE transaction_format = 'CRE'))GOThanks,Julian. |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-07-11 : 12:48:00
|
| you can use a UDF that accepts a transaction_typeID and does the lookup in the table.- Jeff |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-07-11 : 13:56:55
|
| You could also use a trigger. (I can't believe I just said that.)MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-11 : 15:01:08
|
| Hiyo Silver (I can't believe I just said that.) |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-07-11 : 17:18:21
|
| awaaaaaaaay!!!!MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|