This is a blog about stuff I come across as a DBA; fun stuff, hard stuff, weird stuff...just the random day to day stuff that I encounter.

Friday, April 16, 2010

Returning SPIDS for a given Database

I took the SP_WHO2 proc and altered it so that it could take in a parameter containing a database name and return only SPIDs that are active in that database. I pretty much just use this when I'm going to be restoring backups and need to have the database without any connections to it. However in my next post, we'll make use of this proc and the string to table proc I discussed in yesterdays post and use them both to create a script to kill all spids in a list of databases.

No comments:

Post a Comment

About Me

Hello, I'm a database architect with a background in software engineering and website design. I have been working with Databases since 2000, and specifically as a DBA since 2005. In my off time, I enjoy geocaching (high tech treasure hunting), and Scouts.