Tuesday, March 20, 2012

back upwith out any machine specific data

How can i take back up of a data base
with out having any machine/system specific
data in the .bak file?

What exactly do you mean by machine specific data?

When you take a backup your database is backed up, nothing more, nothing less.

If you are talking about the file location this can be changed in the RESTORE statement.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

Data or information? What issues are you trying to prevent with this? If you do a restore headeronly, you will see the server name that backed up the file. Is that the kind of thing you are concerned about?

Otherwise, as WesleyB said, you can backup on one server and restore to another.

-Sue

|||i cant restore a db ,in another system

i am getting error like

System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Microsoft SQL Server 2005\mydatabase.mdf" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft.SqlServer.Smo)

i am trying to restore from a .bak file

i have sql servrer in D:
but on another system it in c:
|||

That's where the MOVE statement is for.

From BOL:

RESTORE DATABASE TestDB
FROM AdventureWorksBackups
WITH MOVE 'AdventureWorks_Data' TO 'C:\MySQLServer\testdb.mdf',
MOVE 'AdventureWorks_Log' TO 'C:\MySQLServer\testdb.ldf';

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

No comments:

Post a Comment