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.