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


Please Help Members By Posting Answers For Below Questions

What does it mean to normalize a database and why would you do it?

530


what's the difference between delete table and truncate table commands? : Sql server database administration

487


How to change parameter value inside the report?

104


hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.

1559


Do you know sql server 2008 introduces automatic auditing?

517






What stored by the master? : sql server database administration

579


Does sql server 2000 clustering support load balancing?

570


What are magic tables in sql server?

623


What are views in ms sql server?

600


How to add an address record into adventureworkslt?

570


can an automatic recovery be initiated by a user? : Sql server administration

519


Is ssrs support other database except ms sql server?

96


What is inner join? Explain with an example?

690


How to turn on the mssql api module in php?

567


What is row-level compre?

549