Beginner needs help: Backup and Restore DB

  • Hi,

    I am a Visual Basic programmer and I have following problem. I use Windows NT and MS SQL Server 7. I need to Backup a Database (called TRWasser) at a path saved in Win Registry (that's no prob > VB). For example "C:\MSSQL7\Backups\TRWasser\TRWBKP.bak". I even don't know the ending of SQL Backup files, I think it's *.bak. I need to do this per T-SQL code. Well i don't really know how to backup and restore that f****** database. Can anyone help me? I need to do this as soon as possible. Oh i forgot, when restoring the database, it should get another name (for example 'TRW001' or 'TRW002' and so on). Online Help is dumb. Internet dumber (is that word right??? :-)). Books couldn't help me much. Please email me at rann@gmx.at.

    Thanks anyway

    Rannh from Austria

  • Oh I forgot again!

    I only need to backup that database once and then restore it again and again.

    HEEEELP

  • Wow, thanks to all, thats just too much......

  • Try this:

    USE MASTER

    BACKUP DATABASE Northwind

    TO DISK = 'd:\backup\Northwind.bak'

    RESTORE DATABASE TestDB

    FROM DISK = 'd:\backup\Northwind.bak'

    WITH MOVE 'Northwind' TO 'd:\test\testdb.mdf',

    MOVE 'Northwind_log' TO 'd:\test\testdb.ldf'

    -- repeat for each database you want to restore

    RESTORE DATABASE TestDB2

    FROM DISK = 'd:\backup\Northwind.bak'

    WITH MOVE 'Northwind' TO 'd:\test\testdb2.mdf',

    MOVE 'Northwind_log' TO 'd:\test\testdb2.ldf'

    Michael J. Carter

    Volcanic Technologies

    michael@volcanictech.com

  • thank you

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply