Hi
How can i make backup on the other computer.
1. SQL computer is express edition, and computers are in workgroup?
2. SQL computer is express edition and is not on domain, and backup computer is on domain.
thanks
alex
Hi,you can simply make a backup by connecting to the server and issue a backup command LIEK BACKUP DATABASE (...) the exact syntax can be found in the BOL. if you want to store the backup file on a network share you have to priviledge the user connecting to the SQL Server for writing to the backup directory. The easiest way would be to allow guest or everyone access, the more proficient way would be to privilege the connecting user for accessing the folder.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||
You can always use the SMO System in .Net and code a solution, here is a small example, I have not tested it yet but you should be able to see the code needed.
try
{
Server server = new Server(Environment.MachineName + "\SQLExpress");
BackupDeviceItem bdi = new BackupDeviceItem(@."C:\test.bak", DeviceType.File);
Backup backup = new Backup();
backup.Database = "Test";
backup.Devices.Add(bdi);
backup.Action = BackupActionType.Database;
backup.SqlBackup(server);
}
catch(SqlException ex)
{
}
I just saw that you wanted to then Restore it on another computer. You can also do this with the SMO Objects, this way you could have the one solution that could create the replicated database.
There are other options that you could use like replication and standby servers but I do not know about the fuctions in the express products I will have to have a look and see what can be done.
No comments:
Post a Comment