Ok... let's ask the next logical question...
Let's say that I DON'T want to use Master for anything but I would like to have a central repository of common code for use across any and all databases much like you can do with Master. For example,
In Database "A", I have a table called "TableA". In Database "B", I have a stored proc called "ReadTableA". While Database "A" is the current database, I want to execute the "ReadTableA" stored procedure which is located in Database "B" and still have it use "TableA" from Database "A".
Does anyone know how that can be done without the use of dynamic SQL? I've tried synonyms and can execute "ReadTableA" from Database "A", but it expects "TableA" to be in Database "B" where "ReadTableA" lives.
It would be real handy for this to work... we're building multiple client databases and I'd like all of the code to be centralized without having to put it in Master.
Personally, I don't believe it can be done without dynamic SQL but I thought I'd ask.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is usually not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs