T-SQL insert

  • I have to insert values from Table A to Table B. Table B has a Reason column that will be the same for every entry.

    So let's say that AccountNumber is from Table A, but I want the Reason to be "Manual Entry" for every AccountNumber from Table A.

  • aroatenberry (3/10/2010)


    I have to insert values from Table A to Table B. Table B has a Reason column that will be the same for every entry.

    So let's say that AccountNumber is from Table A, but I want the Reason to be "Manual Entry" for every AccountNumber from Table A.

    INSERT INTO [Table B] (AccountNumber, Reason) SELECT AccountNumber, 'Manual Entry' FROM [Table A]

    Converting oxygen into carbon dioxide, since 1955.
  • WOW thanks! That worked 😀

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

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