I am writing a script to reduce the size of our databases. It will copy out tables from database A to database B. The process uses bcp in and out. Database B is considerably smaller and will need to grow when necessary. So I do a check after each table to make sure that there is still enough space in database B. If the amount of space falls below a certain percentage I then increase the size of database B. After the the size is increased I move into a new sub routine that verifies that structure of the new table to be copied into is the same as the original table. This process fails as a result of not being able to execute a stored procedure. Giving the error that the proc is not found. I have verified the proc and it works fine. I believe that the reason it is failing is because it trys to run this proc while the alter database is still executing in the database. How can I make sure the process completes before I move into the next subroutine.