Can I create a table with check constrain whose values are dependent on sql query

Posted by Shantanu Gupta on Stack Overflow See other posts from Stack Overflow or by Shantanu Gupta
Published on 2010-06-08T10:18:08Z Indexed on 2010/06/08 10:22 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

Is it possible to create a table which has a check constraint on one of the column whose value lies within the result set given by another sql query

eg.

create table tablename ( name varchar(10), rollno int )check rollno in (select rollno from anotherDatabase.TableName,candidateRoll)

or any thing like that.

I dont have to use it anywhere but still want to know.

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server