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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM