您的位置:首页 > 数据库

SQL Server如何将查询的内容保存到新的sql 表中

2017-05-24 15:07 381 查看
我是采用语句将 查询后的数据保存到一个新表中

1)采用into table 语句,需要保存到的这个新表不需要提前创建

select *into NewTable from Table  --插入新表的语句 into tablename


2)采用insert table语句,需要保存到的这个新表不需要提前创建

CREATE TABLE [dbo].[NewTable](
[fdSequenceID][bigint] not null,
[fdInnerTime][date] not null,
[fdTime][date] not null,
[fdData][float] null,
[fdState][int] not null,
[fdUpdateTime][datetime] not null,
[fdRate] [float] null,
[fdCreateTime][datetime] not null
)

insert NewTable select * from Table
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: