I'm doing this query :
CREATE TABLE nova_tabela AS
SELECT * FROM tabela_copiada;
I'm getting the following error :
Incorrect syntax near the keyword 'SELECT'
I already searched the syntax and I think it is correct. Can anyone help me?
I'm doing this query :
CREATE TABLE nova_tabela AS
SELECT * FROM tabela_copiada;
I'm getting the following error :
Incorrect syntax near the keyword 'SELECT'
I already searched the syntax and I think it is correct. Can anyone help me?
The correct syntax is
SELECT colunas
INTO tabelaNova
FROM TabelaQueDesejaCopiar
WHERE Condicao
SELECT ... INTO creates a new table in the default filegroup and inserts in it the rows resulting from the query
Your select would look like this:
SELECT * INTO nova_tabela FROM tabela_copiada