View Single Post
  #3  
Old 03-23-2004, 02:08 PM
SStory
Guest
 
Posts: n/a
Default Re: Backup/Restore question

I thought I might have to connect to master for that.
thanks.

Shane

"Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.co m> wrote in
message news:O7Ai9$REEHA.3372@TK2MSFTNGP10.phx.gbl...
> > I would need to either somehow connect and install a blank copy of the
> > database and then restore from the backup file???

>
> No need to create a "blank database" first. The database is created for

you
> when you execute the RESTORE command.
>
>
> > Now how do I connect to the server to do this if the database isn't
> > there--via ADO.NET conn string?

>
> As for your connection from ADO, just connect to the master database and
> execute your restore command from there.
>
>
> > also am I correct that a restore will wipe-out/replace the existing

> database
> > with the backed up one?

>
> Yes, assuming the existing one has the same layout for the database files.
> If not, then you'll get an error message. You can either delete the

database
> first and then do the restore or use the REPLACE parameter to the restore
> command (same thing).
> --
> Tibor Karaszi, SQL Server MVP
> [url]http://www.karaszi.com/sqlserver/default.asp[/url]
>
>
> "SStory" <TheStorys@TAKEOUTTHISSPAMBUSTERsofthome.net> wrote in message
> news:%23dB$q7REEHA.712@tk2msftngp13.phx.gbl...
> > I want to offer a simple backup/restore option in my vb.net app.
> >
> > So I did BACKUP DATABASE MYDB TO DISK="D:\SOMEFILENAME.BKP
> >
> > I execute this via a SQLCommand object.
> >
> > backup is simple. But say the database gets wiped out, then they

> reinstall
> > MSDE.
> >
> > I would need to either somehow connect and install a blank copy of the
> > database and then restore from the backup file???
> >
> > Now how do I connect to the server to do this if the database isn't
> > there--via ADO.NET conn string?
> >
> > Am I missing something?
> >
> > also am I correct that a restore will wipe-out/replace the existing

> database
> > with the backed up one?
> >
> > Thanks
> >
> > Shane
> >
> >

>
>



Reply With Quote