In my project I have two separate DBs on the same server. The DBs are self-sufficient except for three columns in DB ‘B’ that need to be accessed in DB ‘A’.
Are there performance considerations if I were to have a stored proc in A that accessed three columns from B directly?
Currently, we run a nightly job to import the needed data from table B to table A, so that the stored proc isn’t going out of the scope of A.
Is that the best method?
Are cross DB stored procs within best practices?
To clarify the other posters comments.
There is no ‘direct’ negative performance impact when using cross database access via stored procedures. Performance will be determined by the underlying architecture of the individual databases, i.e. indexes available, physical storage locations etc.
This is actually quite a common practice and so long as you follow standard query tuning principals you will be just fine.