Home Forums SQL Server 2005 Development Separate Login for a query in a stored procedure RE: Separate Login for a query in a stored procedure

  • thanks ......but it didnt work

    the job contains following code:

    ---------------------------------------------------

    EXECUTE AS LOGIN = 'domain\sqlman'

    GO

    DECLARE @EndDate DATETIME

    SET @EndDate = GetDate()

    EXEC dbo.ap_mtn_Sync_Table_data @EndDate, 'LU_'

    ------------------------

    with above code it gives below error :

    Executed as user: 'domain\SQLMan. SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. [SQLSTATE 42000] (Error 65535) OLE DB provider "SQLNCLI" for linked server "idb\DEV" returned message "Login timeout expired". [SQLSTATE 01000] (Error 7412) OLE DB provider "SQLNCLI" for linked server "Idb\DEV" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.". [SQLSTATE 01000] (Error 7412). The step failed.

    ---------

    but if i exclude [execute as login = 'domain\sqlman' ] from above code

    it gives :

    Executed as user: domain\SQLMan. Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. [SQLSTATE 28000] (Error 18456). The step failed.

    Please suggest

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)