I am stuck here.
I have 3 databases, A, B and C. Databases A & B contain my data for two different locations. Database C contains my custom stored procedures and functions. I would like to be able to call a stored procedure which resides in database C from database A. I want the stored procedure code to run against my data in database A.
I then would want to be able to call that same stored procedure from database B. Eventually, I could have several additional databases and I am trying to keep from having to create the same stored procedures in each and every database. My goal is to have one database C, which contains all of my utility procedures and functions.
My problem today is that when I call the stored procedure in database C, it is running against the data/tables in database C not database A. I also would prefer not to hard code object names in my stored procedures. Can this be accomplished with passing parameters to my sp in database C that will basically tell it where the data is?
Thanks
I have 3 databases, A, B and C. Databases A & B contain my data for two different locations. Database C contains my custom stored procedures and functions. I would like to be able to call a stored procedure which resides in database C from database A. I want the stored procedure code to run against my data in database A.
I then would want to be able to call that same stored procedure from database B. Eventually, I could have several additional databases and I am trying to keep from having to create the same stored procedures in each and every database. My goal is to have one database C, which contains all of my utility procedures and functions.
My problem today is that when I call the stored procedure in database C, it is running against the data/tables in database C not database A. I also would prefer not to hard code object names in my stored procedures. Can this be accomplished with passing parameters to my sp in database C that will basically tell it where the data is?
Thanks