INSERT INTO SELECT*for SQL Server,不可能,我是否正确?

Sam*_*lly 3 sql-server sql-server-2008

使用SQL Server 2008 R2

显然可以做到

INSERT INTO Table1 SELECT * FROM Table1 where Id=1234
Run Code Online (Sandbox Code Playgroud)

看:W3Schools

但在SQL Server中,这不起作用.我是否认为SQL Server不支持上述INSERT语句,并且需要专门指定列.

谢谢.

编辑

上面的SQL不完整,现在已经更正

jue*_*n d 6

您错过了要插入的表的名称

insert into destination_table
select * from source_table
Run Code Online (Sandbox Code Playgroud)

当然,这仅适用于具有相同列的表.如果您只想插入特定列,则还需要指定它们

insert into destination_table (col1, col2)
select col7, col3 from source_table
Run Code Online (Sandbox Code Playgroud)