MSSQL2000
Windows2000
We store user activity logs in a global database. I have a SP that reads those logs and outputs basically 'who did what, and how many times?'
I need to be able to run the SP from a specific customer database, and have it use the global database.
I tried using 'USE dbname', but SQL doesn't allow me to use 'USE' in a SP.
QUESTION: What is the best way to 'use' a different database in a SP?
Windows2000
We store user activity logs in a global database. I have a SP that reads those logs and outputs basically 'who did what, and how many times?'
I need to be able to run the SP from a specific customer database, and have it use the global database.
I tried using 'USE dbname', but SQL doesn't allow me to use 'USE' in a SP.
QUESTION: What is the best way to 'use' a different database in a SP?