SQL Server How to insert current results into table

AMcNall

I have just run a very lengthy query for which the results are very useful.

Unfortunately I did not insert the results into a table, they are only displayed in the results view is there any way to store the current results table into a temp table? The data obviously exists.. Is something possible like:

SELECT * INTO #tempresults FROM CurrentResults

Where currentresults points to... current results

Vado

You can try to save that results as tab separated file. To do that click in the little blank square on top left of the results. This will select all results you see. After that do right click on the same little square and select Copy with Headers.

enter image description here

This will copy all results in the clipboard using tabs as columns delimiter and new line symbol (\r\n) as rows delimiter. Paste it to the new file. Now you can use Import Data menu to insert your results in the table (new one or existing one):

enter image description here

Select Flat File Source as Data Source in Import Wizard, choose the file you made. Be sure to set a proper DataType for each column you importing in Advanced menu on the left. Otherwise you will get some errors/warnings during import:

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get current identity number of specific table in sql server compact

From Dev

SQL Server INSERT into huge table is slow

From Dev

How to split string and insert values into table in SQL Server

From Dev

How to insert into an existing temp table in SQL Server

From Dev

How to Insert xml data into SQL Server table?

From Dev

How to insert multiple values in SQL Server table?

From Dev

SQL Server query results as INSERT

From Dev

insert data in sql server from other table

From Dev

How to insert images into SQL Server database table

From Dev

SQL Server: how to insert a record into related table during an update?

From Dev

In Oracle SQL: How do you insert the current date + time into a table?

From Dev

Insert A list of objects into SQL Server table

From Dev

SQL Server, How to generate an `INSERT` statement for the rows in an existing table?

From Dev

INSERT INTO WITH Common Table Expression - SQL Server

From Dev

How to insert data to SQL Server table using R?

From Dev

How to insert a time into sql table?

From Dev

How to insert multiple rows into SQL Server Parallel Data Warehouse table

From Dev

Pivot table in SQL Server results in error

From Dev

Insert data into table in SQL Server from XML

From Dev

how to insert multiple values into a table cell in sql server

From Dev

How to get current identity number of specific table in sql server compact

From Dev

How to insert into an existing temp table in SQL Server

From Dev

How to use inserted table in variable in insert trigger sql server?

From Dev

SQL Server : Insert into Relation Table

From Dev

How to insert a list of string into a table of SQL Server database

From Dev

How do i do multiple insert into multiple table in sql server

From Dev

SQL Server error with ' ' insert into table

From Dev

SQL Server How to output multiple results into one table

From Dev

How can I split and insert a string into a SQL Server table?

Related Related

  1. 1

    How to get current identity number of specific table in sql server compact

  2. 2

    SQL Server INSERT into huge table is slow

  3. 3

    How to split string and insert values into table in SQL Server

  4. 4

    How to insert into an existing temp table in SQL Server

  5. 5

    How to Insert xml data into SQL Server table?

  6. 6

    How to insert multiple values in SQL Server table?

  7. 7

    SQL Server query results as INSERT

  8. 8

    insert data in sql server from other table

  9. 9

    How to insert images into SQL Server database table

  10. 10

    SQL Server: how to insert a record into related table during an update?

  11. 11

    In Oracle SQL: How do you insert the current date + time into a table?

  12. 12

    Insert A list of objects into SQL Server table

  13. 13

    SQL Server, How to generate an `INSERT` statement for the rows in an existing table?

  14. 14

    INSERT INTO WITH Common Table Expression - SQL Server

  15. 15

    How to insert data to SQL Server table using R?

  16. 16

    How to insert a time into sql table?

  17. 17

    How to insert multiple rows into SQL Server Parallel Data Warehouse table

  18. 18

    Pivot table in SQL Server results in error

  19. 19

    Insert data into table in SQL Server from XML

  20. 20

    how to insert multiple values into a table cell in sql server

  21. 21

    How to get current identity number of specific table in sql server compact

  22. 22

    How to insert into an existing temp table in SQL Server

  23. 23

    How to use inserted table in variable in insert trigger sql server?

  24. 24

    SQL Server : Insert into Relation Table

  25. 25

    How to insert a list of string into a table of SQL Server database

  26. 26

    How do i do multiple insert into multiple table in sql server

  27. 27

    SQL Server error with ' ' insert into table

  28. 28

    SQL Server How to output multiple results into one table

  29. 29

    How can I split and insert a string into a SQL Server table?

HotTag

Archive