ASNI NULLS and ANSI Warnings error

  • I'm trying to save a query inside a sproc that selects from a specified linkedserver. On check syntax sproc parses okay but when I hit "Apply" to save I get an error indicating i must have ansi nulls and warnings set in order to save. I added "set set ansi_nulls on GO and set ansi_warnings on GO" but still get the same error.

    Query runs fine in Q Analyzer.

    I'm stumped, what can should i do to get the sproc to save? I assume it has something to do with the ability to run in session, which is why it runs okay in QA.

    Much obliged for any info or tips.

    Al

     

  • SET ANSI_NULLS ON

    GO

    SET ANSI_WARNINGS ON

    GO

    CREATE PROC A

    AS

    Select null

    GO

  • Actually I've had to take this a bit farther in some cases ...

    SET ANSI_NULLS ON

    SET ANSI_WARNINGS ON

    GO

    CREATE PROC A

    AS

    SET ANSI_NULLS ON

    SET ANSI_WARNINGS ON

    Select null

    GO

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • In what circumstances?

  • Stored procedure execution. I have an 'MSX' Server executing/downloading tasks/Jobs to 'target' servers. Some of the target server procedures reference a database on the MSX server.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Thanks to all who replied!

    This works:

    SET ANSI_NULLS ON

    SET ANSI_WARNINGS ON

    GO

    CREATE PROC A

    AS

    SET ANSI_NULLS ON

    SET ANSI_WARNINGS ON

    Select null

    GO

Viewing 6 posts - 1 through 5 (of 5 total)

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