Sql-Server Seleccionar en Desde consulta
Frecuentes
Visto 86 equipos
-1
hello i am facing the following challenge:
i am using SQL SERVER and I want to do the following action:
SELECT * INTO existingTable
FROM (SELECT * FROM tbl);
I want to know how is it possible to get query result into a table with a SQL statement
gracias por adelantado.
2 Respuestas
1
Eliminar el from
and the (brackets)
insert into existingTable
select * from tbl
It would be good practice to explicitly name your columns
insert into existingTable (colA, colB, ... )
select col1, col2, ... from tbl
contestado el 28 de mayo de 14 a las 14:05
0
If the fields between the tables are not the same, you will have to type them out:
Insert Into existingTable (field1, field2, field3, ...)
SELECT field1, field2, field3, ... from tbl
contestado el 28 de mayo de 14 a las 14:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas sql-server or haz tu propia pregunta.
You'll have to explain what the problem is. I don't see a question being asked here. - alroc
as I use the following code i get errors regarding ')' even tho it doesn't seem to be the problem - Nadav