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 to check parameter value in stored procedure sql server?
Does partitioning help performance?
What is delete query?
Explain the use of keyword with encryption. Create a store procedure with encryption?
Give a example to search fr a string in all stored procedure in sql server.
Which command is used for user defined error messages?
What is data compression?
Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?
How to insert a new row into a table with "insert into" statements in ms sql server?
Introduction of rollup clause using sum and group by clause?
What are the different types of Indexes available in SQL Server?
Explain ranking functions?
What is trigger explain with program?
Explain aggregate functions?
Explain the properties of sub-query in sql server?