Monday, November 26, 2012

How to INSERT into a table records extracted from another table?

If you want to insert values from one table into another you can use this sql query.

insert into TBL_TARGET([USERNAME],[PASSWORD],[ACTION])
select [USERNAME] ,[PASSWORD], 'I'
from [TBL_SOURCE]


Don't use any extra 'VALUES' or parenthesis.

No comments:

Post a Comment