Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Importing a table
Message
De
15/02/2009 23:33:24
 
 
À
15/02/2009 22:32:16
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01382017
Message ID:
01382023
Vues:
39
What I did for this was:
CREATE DATABASE Test
GO
SELECT * INTO Test..MagazineNETSchedule from MagazineNETSchedule
SELECT * INTO Test..Issue from Issue

GO
BACKUP DATABASE [Test] TO  DISK = N'd:\Test.bak' WITH NOFORMAT, INIT,  NAME = N'my special DB',
 SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
DROP DATABASE Test
GO

CREATE DATABASE Test
GO
RESTORE DATABASE Test FROM  DISK = N'd:\Test.bak' WITH  FILE = 1,  MOVE N'Test' TO N'd:\Test',
  MOVE N'Test_log' TO N'<d:\Test.ldf>',  

NOUNLOAD,  REPLACE,  STATS = 10
GO
<move tables with DROP + SELECT INTO or DELETE + INSERT INTO>
GO
DROP DATABASE Test
GO
But, the restore didn't work as is. I had to do a manual restore. There was some kind of error which I don't remember. As for the move table, I didn't understand what to do exactly so I went from the insert from one database to another.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform