Has anyone come up with a way to test a database connection before trying to execute some SQL? We have a database that gets taken offline to load each day. Sometimes the load process runs late or has to be re-run and runs into the scheduled time of the automated job. I would like to poll the database server and see if it is available and if not wait 1 hour and then try again (3 times max). I can set up a while loop to meet these conditions but I don’t see how to test the connection and bring back a value for my while loop condition to test on. Any ideas? Thanks in advance for any help on this.