RESTORE DATABASE [MyDB2]
FROM DISK = N’D:\Backup\MyDB\MyDB_20080205.bak’
WITH FILE = 1,
MOVE N’MyDB’ TO N’E:\DB\MyDB2.mdf’,
MOVE N’MyDB_log’ TO N’E:\DB\MyDB2.ldf’,
KEEP_REPLICATION, NOUNLOAD, REPLACE, STATS = 10
2010-11-12
Copy and insert rows with identity column
SET IDENTITY_INSERT MakeMOney.dbo.ListingHistory ON <–要設定
insert into MakeMOney.dbo.ListingHistory (ListingItemID,PackageID, ProductID, eBayItemID, Quantity, Sold, Price, HandlingFee, ListingFee, Title, StartTime, EndTime, ItemURL, Duration, Status, WarehouseID, HitCount, Lister, LastReviseDate)select ListingItemID,PackageID, ProductID, eBayItemID, Quantity, Sold, Price, HandlingFee, ListingFee, Title, StartTime, EndTime, ItemURL, Duration, Status, WarehouseID, HitCount, Lister, LastReviseDate from ListingHistory where Status=’Active’ and year(StartTime)<=2008
insert into MakeMOney.dbo.ListingHistory (ListingItemID,PackageID, ProductID, eBayItemID, Quantity, Sold, Price, HandlingFee, ListingFee, Title, StartTime, EndTime, ItemURL, Duration, Status, WarehouseID, HitCount, Lister, LastReviseDate)select ListingItemID,PackageID, ProductID, eBayItemID, Quantity, Sold, Price, HandlingFee, ListingFee, Title, StartTime, EndTime, ItemURL, Duration, Status, WarehouseID, HitCount, Lister, LastReviseDate from ListingHistory where Status=’Active’ and year(StartTime)<=2008
↑insert時要指定欄位
訂閱:
文章 (Atom)