SQLPrepare->SQLExecute with "BACKUP DATABASE" statement on SQL server 2005 RRS feed

  • Question

  • Hi all!

    Another problem with MS SQL 2005. When i try to initiate backup operation via SQLPrepare->SQLExecute then i supposed that SQLExecute will no return until all DB data transferred to virtual device. But it returns early. Does anyone know why? And if i close the handle the backup operation became failed and MS SQL writes the error to log. Ok. Now i wait for backup opearion to complete and close handle only after that. But, i close it immediately after virtual device close SQL Server reports a error. I should wait for about 1 sec to complete operation succesfully.

    Also if i call BACKUP LOG command then SQLExecute not return until backup operation complete.

    Another wierd situation happens to MS SQL 2000, when i use SQLExecDirect function with BACKUP DATABASE statement. After operation complete SQL server not initiate some internal activity to save information about backup which i did, so when i try to restore it reports error about LSN and so. This not happens if i use SQLPreare->SQLExecute.


    Tuesday, March 20, 2007 4:09 PM