Understanding the Implications of ANSI SQL92 SET Options

  • Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/rgill/understandingtheimplicationsofansisql92setoptions_1.asp

  • SQL Server 2000 has a bug that turns ANSI_NULLS OFF before creating a stored procedure. If you query a linked server from your stored procedure, you get ERROR 7405 which complains that ANSI_NULLS needs to be set ON. Well, you try to set it ON prior to creating the stored procedure, but Enterprise Manager turns it back OFF when you go to create your stored procedure. And, you can not SET the value after the stored procedure is created - the stored procedure captures whatever setting was in effect at time of procedure creation. The solution is to add the lines SET ANSI_NULLS ON and GO prior to the CREATE stored procedure statement in your stored procedure. The statements will disappear after the stored procedure has been created. See Microsoft Knowledge Base article ID Q296769.

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

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