How can i give the restrictions for the data entry, if i
wish to enter only I ,II, III, IV in the grade actegory of
student table?
Answer Posted / mohan
create table #test (sno int check(sno in(1,2,3)))
successfull statement:
insert into #test values(3)
failure statement :
insert into #test values(4)
error message:
INSERT statement conflicted with COLUMN CHECK
constraint 'CK__#test__sno__68E599B5'. The conflict
occurred in database 'tempdb',
table '#test________________________________________________
____________________________________________________________
___00000000D7E0', column 'sno'.
The statement has been terminated.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the optimal disk configuration for a database server and what raid configurations would you use if budget is not a constraint?
How do triggers work?
What are the hotfixes and patches in sql server?
Why use view instead of a table?
What are types of storage modes? : sql server analysis services, ssas
How you would rewrite the sql query to return the customerid sorted numerically?
How to access the deleted record of an event?
What is a virtual table in sql?
How to drop existing indexes in ms sql server?
What is raid, and how it can influence database performance?
What is a covering index?
How to rebuild indexes with alter index ... Rebuild?
How to check if a table is being used in sql server?
How can you check the version of sql server?
What is difference between delete and truncate commands?