Home Forums SQL Server 2005 Backups database backup and restore in sql server 2005 RE: database backup and restore in sql server 2005

  • abhishek.c1984 (7/23/2009)


    thanks for the reply,

    I have just executed the query in SQL Server 2005, it worked fine...but the database connection was broken

    -------

    Nonqualified transactions are being rolled back. Estimated rollback completion: 100%.

    Failed to restart the current database. The current database is switched to master.

    RESTORE DATABASE successfully processed 561 pages in 0.350 seconds (13.130 MB/sec).

    ---------------------

    But it failed to start the current database...

    Error:

    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset by peer: socket write error

    Note: How can i use this query in the application?

    It is giving the following error

    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: ALTER DATABASE statement not allowed within multi-statement transaction.

    Don't use a transaction to perform backup or restore operations !!

    ( it does not have a transaction scope - there is no rollback feature for backup / restore !)

    Do not connect to the database you are trying to restore !

    Connect to master or tempdb to perform your database restore operation.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me