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 differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?

1046


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

956


Does partitioning improve performance sql server?

983


What is the difference between value type and reference type?

921


How do you troubleshoot errors in a SQL Server Agent Job?

1059


Explain sql server service broker?

977


What is save transaction and save point?

1202


how can u get last observation in an unknown dataset ?

2436


How to edit table in sql server 2017?

926


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1998


Do you know what are the reporting services components?

976


Which database stores information about replication?

1071


Tell me what is the significance of null value and why should we avoid permitting null values?

985


How to provide login information for a new odbc dsn?

1052


Can we install sql server 2016 on windows 7?

1135