Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

UDP to query the current DB

$
0
0

Hi, 

I'm refactoring my SQL into UDP. The problem is that I want to define the UDP in another DB, because it is a common task that can apply to a bunch of my DBs. 

The SQL works fine before refactoring into UDP in another DB, but having done that, I got the "Invalid object name " error.

I think it is because that previously the "select mycol from mytab" works  under current DB. Having moved to mycommondb, and calling it via

Exec mycommondb..commontask 

would fail, even if still under the current DB. 

Any way to fix it so that my commontask would work with whatever my current DB is? 

Thanks






Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>