I am using PDO to restore a SQL Server 2008 database, and issuing a query to restore the database like this:
$pdo->exec('RESTORE DATABASE [blah] FROM DISK = \'c:\blah.bak\' WITH NOUNLOAD');
But the exec() returns before the database is fully restored, is there any way I can make it wait? If not, is there a query I can run in a loop with a delay, to wait for it to finish?
Thanks