This is been an ongoing problem for me that the SQL people have helped me out with grarely. Currently, here is my situation:
The user clicks the "Restore" button and the program is suppose to automatically Restore a backed up SQL Server database. But, the program finds out that there are other users currently logged into the SQL Server. So, I bring up a message box that says "Users are loged on to SQL do you want to kick them out". If the users click yes, then I need to run "sp_who", get their ID numbers, and kill them from the system, and then run the restore. Wonderful, this will work. But, through code (Visual Basic) when I execute "sp_who" how do I get the returned ID numbers?
Thank you
-N473
The user clicks the "Restore" button and the program is suppose to automatically Restore a backed up SQL Server database. But, the program finds out that there are other users currently logged into the SQL Server. So, I bring up a message box that says "Users are loged on to SQL do you want to kick them out". If the users click yes, then I need to run "sp_who", get their ID numbers, and kill them from the system, and then run the restore. Wonderful, this will work. But, through code (Visual Basic) when I execute "sp_who" how do I get the returned ID numbers?
Thank you
-N473