Link to home
Start Free TrialLog in
Avatar of mathew189
mathew189

asked on

Select from one table and insert into another table

I am writing a stored proc in SQL Server.
It selects value from one table and inserts those values in another table.

IF <some condition>
BEGIN
    DELETE from table1;
    SELECT column1 FROM table2;
    Insert into table3;
END

table3 has 2 columns, first one is an autogenerated number and second one needs to be fetched from table2 and inserted in table3.

Please tell me how to do this.

ASKER CERTIFIED SOLUTION
Avatar of Otana
Otana

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial