[dba-SQLServer] Calling Views From another Databasebutapplyingthem to THIS database

Mike & Doris Manning mikedorism at adelphia.net
Sun Aug 8 18:29:02 CDT 2004


The object you are calling from the other database will always run/affect
the other database -- never the database you are in.  You cannot apply them
to your current database unless you import them into the current database
(thereby changing their database reference).

Doris Manning
Database Administrator
Hargrove Inc.
www.hargroveinc.com
  

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Arthur
Fuller
Sent: Saturday, August 07, 2004 4:02 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer] Calling Views From another
Databasebutapplyingthem to THIS database


Thanks for the reply. If you have a spare moment, please verify your answer.
(I think that you're not quite right, but I am most eager to stand
corrected.)

Copy the Northwind database. 
Create a view that does something interesting.
Delete a few rows from the tables involved in said view.
Open the original Northwind database and execute the view just created,
using the syntax you suggest.

Will the result set show the copy's rows or the original Northwind's rows?
My experiments to date show that the returned rows are from the copied
database (i.e. fewer rows), which implies that the query is executing on the
database it's in rather than the database I'm in. What I want is for said
query to apply to the database I'm in, not the database that the query is
in.

Am I making myself clear? I'm trying only to state the problem, not to be
pedantic or insulting or anything else.

Thanks,
Arthur

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Mike &
Doris Manning
Sent: Saturday, August 07, 2004 3:51 PM
To: dba-sqlserver at databaseadvisors.com
Subject: RE: [dba-SQLServer] Calling Views From another Database
butapplyingthem to THIS database


The syntax is database.dbo.object

You can do same with a table, view, sproc, or function

Doris Manning
Database Administrator
Hargrove Inc.
www.hargroveinc.com


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com





More information about the dba-SQLServer mailing list