Re: Create View on a Remote Database

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Uri Dimant (urid_at_iscar.co.il)
Date: 03/04/04


Date: Thu, 4 Mar 2004 07:37:36 +0200

Tim
I assume you have already created linked server.
CREATE VIEW My_View
AS
SELECT col... FROM
   ServerName.DatabaseName.dbo.TableName WHERE........

Or
If you have not established linked server you can try this one.

declare @StringVar varchar(10),@sql varchar(8000)
set @StringVar = '2450'
  set @sql = '''select * from tablename where id = ''''' +
             @StringVar + ''''''') as a'

exec ('select a.*
  from OPENROWSET(''SQLOLEDB'',''Server'';''user'';''pass'', ' + @sql)

"Tim M" <anonymous@discussions.microsoft.com> wrote in message
news:66E9C3BF-5EB0-44D2-AC82-DAE424DB4464@microsoft.com...
> Hi,
>
> I'm pretty new to SQL Server.
>
> Can someone point me in the general direction for information on how I can
create a VIEW on tables in a different SQL Server 2000 database on a
different server. I have the connection information for this database ie
UserID, Password, etc.
>
> Cheers
> Tim



Relevant Pages

  • Re: Setting up Linked server to MsAccess
    ... "All users should typically be accessing the Access database ... with the user Admin and no password. ... This will set the security so anyone using the linked server ...
    (microsoft.public.sqlserver.security)
  • Re: Setting up Linked server to MsAccess
    ... I'm running SQL Server\Express in "Windows Authenication Mode" (Do I have to ... they are accessing my MS Access linked server? ... Containing folders with MSAccess Database X.mdb ... SQl Express has linked server X mapped via UNC to Database X.mdb ...
    (microsoft.public.sqlserver.security)
  • Re: Setting up Linked server to MsAccess
    ... This will set the security so anyone using the linked server ... At the database level I have added my Server login ...
    (microsoft.public.sqlserver.security)
  • Linked server from SQL Server to Access db on network share?
    ... I have an Access database that exists on a network share ... that I'm trying to link to as a linked server from SQL ...
    (microsoft.public.sqlserver.msde)
  • Linked server from SQL Server to Access db on network share?
    ... I have an Access database that exists on a network share ... that I'm trying to link to as a linked server from SQL ...
    (microsoft.public.sqlserver.server)