Skip to content

Export grid results as a temp table

Alex Bochkov edited this page Dec 24, 2025 · 3 revisions

Enables quick scripting of existing query results as a temporary table definition with data.

Two primary reasons this feature is useful:

  • It produces an easily transferable script that can be executed on another server to recreate the exact same data. This avoids the need for BCP or other data-copy tools. This approach is suitable only for reasonably small data sets. For high-performance or large-volume transfers, use the Data Transfer feature.
  • The scripted output preserves the exact data type definitions for each column. For example, there is no need to guess string lengths or whether a column is INT or BIT. This is particularly helpful during development.

Completed query results:
script-grid-source

Run the command:
export-as-temp-table

Result in the new window:
script-grid-result

Clone this wiki locally