Query Transformation

Asked

Viewed 33 times

0

Does anyone know if it is possible to transfer a SQL SERVER query into a new table? No longer query to be shown with a "show table" command made from a query for example ?

  • Unclear your question, at least for me , but I believe you refer to the metadata tables , https://www.itprotoday.com/sql-server/returning-column-metadata-specific-table

1 answer

2


If you want to create a new table based on the data of a query, use the clause INTO:

SELECT campo1,
       campo2,
       campo3
  INTO nova_tabela
  FROM tabela

SELECT - Clause INTO

SELECT…INTO creates a table in the default file group and inserts in it the lines resulting from the query.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.