Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to put stored proc
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00704050
Message ID:
00705079
Views:
17
Hi David,

>I have several databases on my server that have the same structure. I have a stored procedure that I want to run periodically on each database. Instead of copying the same sp to each database, I could add it to master. If I do that, how do I tell it which database tables I want to reference? I get 'invalid object name' because it looks like it switches to the master database to run the sp. Tell me if I am not making sense.

you can either switch to a specific database with
USE yourdb1
or you can explicitly reference the DB objects with
SELECT * FROM yourdb1..tablename
HTH,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Reply
Map
View

Click here to load this message in the networking platform