Hi All, I am facing a problem in restoring a database in MSSQL Server 2005. Our requirement is to restore a database from a backup file. We are using the following query for restoring the database. "RESTORE DATABASE <New Database Name> FROM DISK = '<Physical Location of backup file>' WITH REPLACE, MOVE '<Logical name of database file>' TO '<Physical location of database file>', MOVE '<Logical name of transaction log file>' TO '<Physical location of transaction log file>'" After this execution, we will be giving some user privilages to this restored database. We are executing the query using ODBC API SQLExecute(). The query is getting executed successfully. But, the problem is, API returns control before complete restoration. So, the program continues to execute the next operation of assigning privilages before restoration, which results in error. So, we want to know if there are any methods to check whether the restoration is completed, so that we can use that before assigning privilages. Thanks in Advance !!