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 are the types of containers in ssis?
How does clustered and non clustered index work?
How to use the inserted and deleted pseudo tables?
How to execute a stored procedure in ms sql server?
What is the difference between lock, block and deadlock? : sql server database administration
How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?
Describe how to use the linked server?
What stored by the master? : sql server database administration
Explain the difference between primary keys and foreign keys?
Explain subquery and state its properties?
What happens if we shrink log file in sql server?
How can windows applications connect to sql servers via odbc?
what is denormalization and when would you go for it? : Sql server database administration
What is transact-sql ddl trigger?
What is the difference between primary key and unique constraints?