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 / soorai ganesh

If u Use SQLSERVER 2005. This will helpful to you


CREATE RULE myRule AS @strGrade IN('I','II','III','IV')
GO
CREATE TABLE myTable
(
empID INT,
empName VARCHAR(50),
empGrade VARCHAR(3),
empSalary NUMERIC(9,2)
);
GO
sp_bindrule myRule, 'myTable.empGrade';
GO


INSERT INTO myTable VALUES(1,'Ganesh','I',59000) -- Valid
INSERT INTO myTable VALUES(1,'Ganesh','II',89000) -- Valid
INSERT INTO myTable VALUES(1,'Ganesh','III',99000) -- Valid
INSERT INTO myTable VALUES(1,'Ganesh','IV',259000) -- Valid
INSERT INTO myTable VALUES(1,'Ganesh','V',259000) --
Invalid

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different methods available under sqlcommand class to access the data?

1096


How to stop a loop early with break statements in ms sql server?

996


How many files can a database contain in sql server?how many types of data files exists in sql server? How many of those files can exist for a single database?

1126


what is a transaction? : Sql server database administration

976


What are the recovery models for a database?

1096


What is the difference between a view and a stored procedure?

1018


What is the difference between varchar and nvarchar datatypes?

1070


Tell me extended events in sql server 2008?

978


How many columns can we include on clustered index ?

968


What is the maximum size of a dimension? : sql server analysis services, ssas

1025


What are data files?

1024


explain different levels of normalization? : Sql server database administration

981


Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?

942


Explain what are sparse columns?

970


what are constraints? Explain different types of constraints? : Sql server database administration

958