INSERTING VALUES IN A TABLE USING CHECK CONSTRAINT

  • HELLO MY NAME IS GEORGE BEGINNER IN SQL

    MY QUESTION IS THAT ,I WANT TO CREATE A TABLE WITH ONE FIELD WHICH HAS TO INSERT ONLY THREE VALUES AFTER THAT FIELD INSERT THRE VALUES IT SHOULD NOT BE ABLE TO INSERT MORE VALUES

    IN DETAIL IF MY TABLE NAME IS 'SOURCE' WHICH CONTAIN ONLY ONE FIELD, NAMED 'CATEGORY'OF TYPE VARCHAR I ONLY WANT TO ENTER THREE VALUES IN THIS AS 'LAND','AIR','WATER' I SHOULD BE ABLE TO INSERT ONLY THIS VALUES AND TEHRE SHOULD BE NO DUPLICATION OF THESE VALUES AND NO OTHER VALUES SHOULD BE INSERTED

    I AM EXPECTING AN EARLY REPLY

  • duplicate thread;

    follow the answered thread here:

    http://www.sqlservercentral.com/Forums/Topic587537-359-1.aspx

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply