Handling sql server connections