Friday, March 30, 2012

Microsoft SQL Server 2005 beta - Database Dump


Hi, I would like to generate a database dump of my Microsoft SQL Server 2005 beta databases.

Does anyone know, how to do it?

Since I have many tables in one database, I would need the dump to include the schema as well as the data,

Thanks a lot for your help!

Use Backup/Restore method to get the Schema with data.

a. Backup Database YourDatabaseName To Disk='D:\Yourdb.bak'

b. RESTORE FILELISTONLY FROM DISK='D:\Yourdb.bak'

GO

c.

RESTORE DATABASE NewDBName

FROM DISK='D:\Database Backups\TTCProvidedData.BAK'

WITH MOVE'OldDatabaseDatafileLogicalName' TO 'D:\NewDBName.mdf',

MOVE OldDatabaseLogfileLogicalName' TO'D:\NewDBName_log.ldf'

change the path and db name accordingly.

Madhu

No comments:

Post a Comment