Ticker
6/recent/ticker-posts
Figaro's Blog
Header Ads Widget
Responsive Advertisement
Home-icon
首頁
MSSQL
在 MSSQL 中跨越不同 DB 複製資料方式
在 MSSQL 中跨越不同 DB 複製資料方式
FigaroY
6月 03, 2019
如果我們需要將位於 MSSQL 中兩個不同 DB 中的資料進行複製,則我們可以透過下列方式來進行操作:
首先,若是 Table 中有欄位是設定為 IDENTITY_INSERT 時,在複製寫入時記得先關閉
SET IDENTITY_INSERT DestinationDB.dbo.Table OFF
接下來,我們便可以把從來源資料庫中篩出來的資料插入到目的地資料庫中
INSERT INTO DestinationDB.dbo.Table ([idx]
, ColumnX
)
SELECT * FROM SourceDB.dbo.Table
張貼留言
0 留言
檢舉濫用情形
搜尋此網誌
Archives
12月 2020
1
6月 2019
1
8月 2017
1
Social Plugin
Popular Posts
Labels
複製資料
1
AWS
1
AWS Cli
1
AWS Device Farm
1
IDENTITY_INSERT
1
linux
1
MSSQL
1
sed
1
unix2dos
1
0 留言