1

I was referencing this question How to export all data from table to an insertable sql format? while looking for a way to create an insert statement for a single row from a table without having to manually write it since the table has many columns. In my case I simply followed the steps listed then performed a ctrl-f search in the resulting script for the record I wanted then copied and pasted that single line to another query window but this would be terrible if I had hundreds of millions of rows. Is there a way to get the same functionality but tell the script generator I only want rows where id = value? Is there a better way to do this using only the out of the box Microsoft tools?

Community
  • 1
  • 1
Don
  • 77
  • 2
  • 6

1 Answers1

1

There is no way to do this, but you can do it by using a temp table

Create a new table by inset into and select those records which you want to insert.

Create the script and change the table name by using find and replace.

finally drop that temporary table.

Ali Adravi
  • 21,707
  • 9
  • 87
  • 85