I am executing:
exec sp_who
go
Is it possible to sort by a field like this?
exec sp_who order by dbname
go
How would I accomplish this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can accomplish this using OPENROWSET as per this question.
If for whatever reason you are unable to use OPENROWSET then you will have to create a temp table that matches the output of
sp_whoexactly.e.g