Had an issue recently trying to figure out what application was holding a connection open on a SQL server, and here's the lowdown on tracing it down. Firstly, go into a query window and do the following:
sp_who
select spid,hostname,hostprocess from master.dbo.sysprocesses
The 'sp_who' will list the open connections. Look through this list to find any where the ‘dbname’ column is the database you're interested in, and then look for the value in it’s SPID column. The 'sysprocesses' query will give you, for each SPID, the hostname and windows process id (‘hostprocess’) which you can then look up in the task manager on that particular computer.

Thanks for reading! And if you want to get in touch, I'd love to hear from you: chris.hulbert at gmail.

Chris Hulbert

(Comp Sci, Hons - UTS)

iOS Developer in Sydney.

I have worked at places such as Google, News Corp, Fox Sports, NineMSN, FetchTV, Woolworths, and Westpac, among others. If you're looking for a good iOS developer, drop me a line!

Get in touch:
chris.hulbert@gmail.com
github.com/chrishulbert
linkedin
my resume



 Subscribe via RSS