Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Access data through view .

Author  Topic 

admin001
Posting Yak Master

166 Posts

Posted - 2005-02-15 : 06:24:36
Hi ,

I have setup a dev. SQL server with three instances as server\instance1 , instance2 and instance3 respectively . Now I have view in one of the databases in instance1 that needs to access another database from instance2 . However I noticed that I can't do it . I have view in instance1 as

CREATE VIEW dbo.vconsumer
AS
SELECT *
FROM Profile.dbo.consumer

Now profile is the database which it is trying to access which is not in instance 1 , but in instance2 . How do I modify this view so that it can access the data in instance2 . I tried

CREATE VIEW dbo.vconsumer
AS
SELECT *
FROM server\instance2.Profile.dbo.consumer

But it displayed as incorrect syntax "\" . I even tried configuring linked server , but no success . Can I get some help on this please without having a duplicate database profile in instance 1 . Can it be avoided in any ways ???

Thank you .

nr
SQLTeam MVY

12543 Posts

Posted - 2005-02-15 : 06:59:23
CREATE VIEW dbo.vconsumer
AS
SELECT *
FROM [server\instance2].Profile.dbo.consumer

Or create the linked server with a more friendly name or create an alias for it using client network services.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -