Is there a way to script changing the linked server password.
I tried doing
EXEC Srv01.master.dbo.sp_addlinkedsrvlogin
@rmtsrvname = N'OracleServerA', @locallogin = NULL , @useself = N'False',
@rmtuser = N'system6', @rmtpassword = @NewSystemPassword
EXEC Srv02.master.dbo.sp_addlinkedsrvlogin
@rmtsrvname = N'OracleServerA', @locallogin = NULL , @useself = N'False',
@rmtuser = N'system6', @rmtpassword = @NewSystemPassword
EXEC Srv02\Binstance.master.dbo.sp_addlinkedsrvlogin
@rmtsrvname = N'OracleServerA', @locallogin = NULL , @useself = N'False',
@rmtuser = N'system6', @rmtpassword = @NewSystemPassword
But I get error
Msg 7202, Level 11, State 2, Line 8
Could not find server 'Server01' in sys.servers. Verify that the correct
server name was specified. If necessary, execute the stored procedure
sp_addlinkedserver to add the server to sys.servers.
If I run the script on a different server sometimes I get
same message but with Server02 in the error message.
Thanks,
How about using SQLCMD and changing the server\instance that you log into/
Then the script would be the same.
John
As John says, it probably better to do this from a BAT file that
run SQLCMD.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
You must first create a linked server to Srv01 on the current SQL Server
instance. Otherwise you will encounter that error message. You can use the
stored procedures sp_addlinkedserver and sp_addlinkedsrvlogin to create the
linked server first.
For more information, please refer to:
sp_addlinkedserver
http://msdn.microsoft.com/en-us/library/ms190479.aspx
Best regards,
Charles Wang
""Charles Wang [MSFT]"" wrote:
> .
>
"John Bell" wrote:
> .
>