By Jim Hudson, Senior Technology Evangelist – OakTree Staffing & Training
“How do I find who is using a particular database from the command line?”
sqlcmd /Scomputername /Q “sp_who2” | findstr /I databasename
C:\tmp>sqlcmd /S. /Q “sp_who2” | findstr /I pubs
63 sleeping CONTOSO\administrator CONTOSO-DC . pubs AWAITING COMMAND 0 0 07/26 07:46:06 .Net SqlClient Data Provider 63 0
@Hudson_OakTree. I’ll be periodically be providing tech tips to hopefully help you out of some binds. Don’t forget to say hi!
If your team could use instructor-led Microsoft Certified IT training that can be taken from absolutely anywhere, look no further than OakTree Staffing & Training.