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

我是采用语句将 查询后的数据保存到一个新表中

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

 

posted @ 2017-05-24 15:07  老张哈哈哈  阅读(8109)  评论(0编辑  收藏  举报