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
You are doing log shipping due to some reasons it is failing. How you will proceed from there
Using the customer, and order table in northwind database, please write a query to produce xml?
What are the different types of sql server replication? : sql server replication
Is null vs coalesce?
What are the advantages of using third-party tools?
What are a scheduled jobs or what is a scheduled tasks?
What is data modification?
What is autocommit mode in sql server?
Explain a join?
What are sql dirty pages?
What is the datatype of rowid?
What is the command dbcc checkdb used for?
What is acid db?
How to use transact-sql statements to access the database engine?
Do you know what guidelines should be followed to help minimize deadlocks?