inserting data

  • Hi

    I have two Tables, they are the same, but Table1 has data but Table2 does not have data , both of them have 3 fields, Filed1, Filed 2 and Field 3, Filed Three is "not null".

    Now I want to write TSQL for insert data from Table1 in to Table2, but only tha data for Filed1 and Filed 2,

    But because Field 3 is defiend Not Null, I can not,

    would you please help me?

  • If you dont want to insert data in Field3 then you can remove it...

    OR

    you can defined DEFAULT value for Field3 so that you will not get error while inserting data from table1 to table2

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Hi,

    passing some default values or altering table to add default constraint would be better solution.



    Praveen D'sa
    MCITP - Database Administrator 2008
    http://sqlerrors.wordpress.com

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

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