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

Arthur Fuller artful at rogers.com
Sat Aug 7 15:02:15 CDT 2004


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





More information about the dba-SQLServer mailing list