Quantcast
Channel: Rss Feed - SSMSBoost Add-in discussion board - Forum
Viewing all articles
Browse latest Browse all 825

Generate Inserts into table name from query

$
0
0
Frequently I will select out a set of rows from a single table matching various rows that need to be deleted in a database and then will want to script that result out and save it in case it needs to be reinserted into the table after the delete. Would it be possible to generate a template that could replace the table name for the insert with the first table of the query? So for instance:

SELECT *
FROM MyTable
WHERE SomeCondition

....

Would then generate the script:

INSERT INTO MyTable (.....)
VALUES (...)


I know the stock INSERT INTO template gets me 95% the way there, but it doesn't allow me to use the table name from the SELECT statement for the table name to insert it into.

Thanks
Go to last post

Viewing all articles
Browse latest Browse all 825

Latest Images

Trending Articles



Latest Images