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.
| Author |
Topic |
|
msmcfadd
Starting Member
2 Posts |
Posted - 2004-09-09 : 15:54:08
|
| I’m trying to create a view to a table that is on a different sql server than the one my view is in. The problem I’m having is figuring out how to tell the view what username and password to use. By default it wants to use the username and password of the sql server that I’m writing the view in. Here is the situation and a test I tried. There are 3 different servers (I will call them Server1, Server2, and Server3) I’m an admin on servers 1 & 2 and know that they both have the same password, that is why I can successfully run this view from Server1: SELECT * FROM Server2.DBname.dbo.TablenameBut Server3 is owned by a different department so if I try this from Server1: SELECT * FROM Server3.DBname.dbo.TablenameIt gives me an error saying invalid password for saThis makes since because I do not know the sa password on Server3. Is there a way I can tell the view the userid and password the other department set up for me to use on Server3 when it tries to link to Server3?Mark |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2004-09-09 : 16:05:15
|
| When you configure the linked server there is a way to tell it what username and password to use.Look at sp_addlinkedsrvlogin in BOL.-Chadhttp://www.clrsoft.comSoftware built for the Common Language Runtime. |
 |
|
|
msmcfadd
Starting Member
2 Posts |
Posted - 2004-09-09 : 17:22:14
|
| That was what I needed, Thanks Chad! |
 |
|
|
|
|
|