Re: Create View on a Remote Database
From: Uri Dimant (urid_at_iscar.co.il)
Date: 03/04/04
- Next message: Steve Kass: "Re: ELSE UPDATE"
- Previous message: Roji. P. Thomas: "Re: string from column value"
- In reply to: Tim M: "Create View on a Remote Database"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Steve Kass: "Re: ELSE UPDATE"
- Previous message: Roji. P. Thomas: "Re: string from column value"
- In reply to: Tim M: "Create View on a Remote Database"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|