Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 SQL Server 中,它们本质上做同样的事情。每种方式的优点/缺点是什么?
select * into table
对比
insert into table select *
我正在寻找诸如性能、最佳实践、可维护性等原因。
SELECT ... INTO mytable创建一个新表。如果mytable已经存在则失败。
SELECT ... INTO mytable
mytable
INSERT ... INTO mytable插入到现有表中。如果mytable不存在则失败。
INSERT ... INTO mytable
SELECT * INTO TABLE
这会将数据插入到新表中
INSERT INTO TABLE SELECT *
将数据从现有表复制到另一个现有表