Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-03-13 : 08:58:33
|
| Zel writes "My problem is how to restore a SQL7 database? I mean how do i code it in vb. if i need a stored procedure for making a backup of my database and restoring it, what are the codes? (can i ask for it?) Please help me..." |
|
|
Jay99
468 Posts |
Posted - 2002-03-13 : 09:08:23
|
Yikes. My suggestion would be to ask your dba to do a restore.I am not sure what you mean here, but stored procedures are not written in VB (yet). Maybe those where two questions?!?Book on Line (the digital documentation installed with SQL Server) and just about any SQL Server Reference will surely have a chapter on BACKUP and RESTORE (those are in caps because they are the 'codes' you will be using).If you post the...- database name,
- backup device name or physical backup file location,
- logical file names (for the data and log files),
- desired restored file location (for the data and log files)
...someone here might be kind enough to just write it for you for free.Jay |
 |
|
|
aclarke
Posting Yak Master
133 Posts |
Posted - 2002-03-14 : 00:51:45
|
Hmm. I'm not a VB programmer and haven't been for quite a number of years (thank God) but since it can all be done in SQL I imagine it can be done in VB. WHY is another question, but not one that you asked...I occasionally have to do database restores from file backups on disk. I keep a little script around that I modify each time as needed. It goes a little something like this:restore filelistonly from disk = 'c:\DatabaseBackup.bak'restore database [DatabaseName]from disk = 'd:\DatabaseBackup.bak'withmove 'DatabaseName_Data' to 'd:\SQLDATA\Data\DatabaseName.MDF',move 'DatabaseName_Log' to 'd:\SQLData\Data\DatabaseName.LDF',replace This may or may not be helpful to you but the real moral of the story is that I learned how to do this from Books Online, as Jay99 also suggested.Good luck! |
 |
|
|
|
|
|