Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 are the types of containers in ssis?

1095


How does clustered and non clustered index work?

851


How to use the inserted and deleted pseudo tables?

916


How to execute a stored procedure in ms sql server?

1071


What is the difference between lock, block and deadlock? : sql server database administration

992


How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?

1046


Describe how to use the linked server?

1066


What stored by the master? : sql server database administration

1030


Explain the difference between primary keys and foreign keys?

944


Explain subquery and state its properties?

970


What happens if we shrink log file in sql server?

913


How can windows applications connect to sql servers via odbc?

1062


what is denormalization and when would you go for it? : Sql server database administration

1118


What is transact-sql ddl trigger?

1053


What is the difference between primary key and unique constraints?

905