espin,
Yes, unless we see your full code, it is not easy to suggest any way.
As Far As I Understood your post, I dont think you can do it the way you are trying to.
Assume you are into db2 now and the stored proc is in db1
use db2
go
Execute db1.dbo.storedprocname
go
Still it would use the DB_NAME() as db1, as stored proc is an object of db1. May be replicating the SP to the db2 would solve your problem.
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|