Showing posts with label use Select results into Insert script. Show all posts
Showing posts with label use Select results into Insert script. Show all posts

Thursday, July 19, 2018

Create an insert script using SELECT

There are many third party tools that provides this feature, but you can use a simple
select statement  easily create an insert script as shown belowe.

Suppose you have employee table  and want to use it to generate data for another table.


select 'insert into Table1 values(' + Id + ', ' + name + ')' from employee


Cheers,
Samitha