Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ?

Posted
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.
Posted

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)

Posted

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.

Posted

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 ?

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...