Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure in another DB

Status
Not open for further replies.

CodeJunkee

Technical User
Joined
Jan 8, 2003
Messages
5
Location
US
I am not a big SP expert. I need to do either:

1) Access a table from another db from inside a sp, that is not in the current db
2) Access an sp from another db from the current db

I couldn't find a way to do either???

 
If the database is on the same sql server just use the full object name

databasename.ownername.tablename

you can omit the owner if dbo, but leave the stops.

Mydb..MyTable or MyDb..MySp
 
Thanks. That did it. I knew it was something simple. I guess I don't go cross db very much. I tried with one dot and didn't work. Forgot I needed two (..).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top