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
How can you fetch alternate records from a table?
How to filter out duplications in the returning rows in ms sql server?
How would you choose between a clustered and a non-clustered index?
Explain important index characteristics?
what are constraints? : Sql server database administration
What is user-defined functions? What are the types of user-defined functions that can be created?
What is the report builder?
what are user defined datatypes? : Sql server database administration
Explain trigger and its types?
What is the difference between row_number and dense_rank?
How to send email from database?
What are database states in ms sql server?
How is a full-text index updated?
How can I check that whether automatic statistic update is enabled or not?
Explain what is dbcc?