desmondtan Posted March 12, 2003 Posted March 12, 2003 Does anyone knows how to backup and restore as well as attach anda detach databse from a MSDE 2000 Sql server ? Quote
joteke Posted March 17, 2003 Posted March 17, 2003 It can be done using same commands as with normal SQL 2000 db. Go to http://msdn.microsoft.com/sqlserver and find the SQL 2k documentation. Find there commands: BACKUP RESTORE For attaching/detaching db look for procedures: sp_attach_db sp_detach_db Quote
desmondtan Posted March 18, 2003 Author Posted March 18, 2003 Hi joteke , need advice form you . Do you have any experience to deploy the MSDE 2000 databse to another machine ? If I would like deploy my MSDE databse to another machine , which method is going to use - "backup/restore or attch/detach". "osql" can only run at command prompt , how to I run on Windows form based ? Quote
joteke Posted March 18, 2003 Posted March 18, 2003 If you use Windows Forms, then you'd use ADO.NET to connect to the db. In that case I would use sp_attach_db and sp_detach_db procedures. Just note that they are run agains master database and you need to be sa to do it. Quote
desmondtan Posted March 19, 2003 Author Posted March 19, 2003 Hi joteke, thank you very much . I have one question to ask : 1. when attach/detach database using osql , we must specified the servername\instance , eg: osql -E -S servename\instance - i sp_attach.sql In Vb.net , we can replace the servername with [local] ( if msde is on local), but osql doesn't allow . How to I do it if I want to create a batch file for this command sp that it can run on diffrent machine (assume that the instance is same) Quote
joteke Posted March 19, 2003 Posted March 19, 2003 Why would you use osql in case you do it from remote machine? Couldn't tou just use ADO.NET and run procedures against master db? here's about osql's syntax: S server_name[\instance_name] Specifies the instance of Microsoft® SQL Server� 2000 to connect to. Specify server_name to connect to the default instance of SQL Server on that server. Specify server_name\instance_name to connect to a named instance of SQL Server 2000 on that server. If no server is specified, osql connects to the default instance of SQL Server on the local computer. This option is required when executing osql from a remote computer on the network. Quote
desmondtan Posted March 20, 2003 Author Posted March 20, 2003 very that I still new in Vb.net , the MSDE is installed on local machine, deployed together with the program . Could you show me where I can find explanation on how to use ADO.NET to backup/restore database ? Quote
desmondtan Posted March 20, 2003 Author Posted March 20, 2003 Yes . I get it. In the batch , I do this way : SET para=hostname osql -E -S %hostanme%\instance .......... At command prompt , type the batchfilename . You can execute the osql in differnet machine. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.