Hi all,I have a problem with running SP which connect to the active directory.I wrote:ALTER PROCEDURE [...System_CreateActiveDirectoryUserTable] AS BEGIN IF NOT EXISTS (SELECT srv.name FROM sys.servers srv WHERE srv.server_id != 0 AND srv.name = N'ADSI')BEGIN EXEC master.dbo.sp_addlinkedserver @server = N'ADSI' ,@srvproduct=N'Active Directory Service Interfaces' ,@provider=N'ADSDSOObject' ,@datasrc=N'adsdatasource'EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'ADSI' ,@useself=N'False' ,@locallogin=NULL ,@rmtuser=N'****' ,@rmtpassword=**** END
/************/.... (some code)..And then I try to do F5 and I got this message:Could not find server 'ADSI' 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.but when I running the Code I wrote to you Manualy and then the other code its work.what could be the reason?thanksliat.