Rowset and remote server

  • We have two servers GS1 and LPT. LPT server is not linked on GS1.

    The following script works fine in Query Analyser on GS1

    SELECT * FROM OPENROWSET('SQLOLEDB','LPT';'globsys';

                  'globsys','SELECT * FROM posta.dbo.sestavy')

    The same script in the stored procedure

    CREATE PROCEDURE dbo.zkouska AS

    SET ANSI_NULLS ON

    SET ANSI_WARNINGS ON

    SELECT * FROM OPENROWSET('SQLOLEDB','LPT';'globsys';

            'globsys','SELECT * FROM posta.dbo.sestavy')

     

    RETURN

    get this error message

    ERROR 7405: Heterogenous queries require the ANSI_NULLS

    and ANSI_WARNINGS options to be set for the connection.

    This ensures consistent query semantics.

    Can anyone help me

    Thanks

    Mirek

  • Use:

    SET ANSI_WARNINGS ON

    SET ANSI_NULLS ON

    GO

    CREATE PROCEDURE....

    ....

    To turn on These options before creating your SP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply