I have an app which auto-starts and connects to sql server but the thing is I am not sure if the sql server is started first and from time to time my app encounters an error wherein it cannot connect to the sql server, I would assume it is because sql server hasn't fully started yet or that my application started first, is there something I could do so that my app will wait for sql server to start before connecting?

TIA