New training course: Customizing SQL Prompt. Watch now.

Auto-create Select Into Code From Table Selection in Query

EdCardenEdCarden Posts: 114 Bronze 3
edited November 11, 2020 4:37PM in SQL Prompt
This may already exists and i simply am unaware of it. If I have a query like this:

SELECT Col1,Col2,Colx FROM TABLEA A

Is it possible with SQL Prompt to select the table name and with the click of a mouse button auto-create an INSERT statement for TABLEA?

I know that SQL Server Mgt Studio will create this if you have the table selected in the Object Explorer pane but I'd love to be able to highlight a table name in a query and single-click to get the same.

Thoughts?

Tagged:

Answers

  • Eddie DEddie D Posts: 1,686 Rose Gold 5
    Hi, thank you for your forum post.

    Not exactly, there is a default SQL Prompt snippet to add an insert statement.  After entering your query:

    SELECT Col1,Col2,Colx FROM TABLEA A 

    then type ii this will bring up the default SQL Prompt snippet INSERT INTO.

    Further information on the snippet feature in SQL Prompt can be found here.  Also if you open SQL Prompt menu on the toolbar and select the Snippet Manager option towards the bottom on the menu.

    Many Thanks
    Eddie


    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
Sign In or Register to comment.