Professional Web Applications Themes

how to suppress "warning null value..." - Microsoft SQL / MS SQL Server

Hello, I get the following warning when I run an sp in query yzer which returns some null values. Warning: Null value is eliminated by an aggregate or other SET operation. The sp is supposed to list a count of 6 items whether or not the items exist in the count. If some items are not in the count the sp adds them through a cross join to the same table. Thus I get the null warning message. The sp works fine and returns the proper results. Is there a way to suppres the warning message? Thanks, Rich *** Sent ...

  1. #1

    Default how to suppress "warning null value..."

    Hello,

    I get the following warning when I run an sp in query yzer which
    returns some null values.

    Warning: Null value is eliminated by an aggregate or other SET
    operation.

    The sp is supposed to list a count of 6 items whether or not the items
    exist in the count. If some items are not in the count the sp adds them
    through a cross join to the same table. Thus I get the null warning
    message. The sp works fine and returns the proper results. Is there a
    way to suppres the warning message?

    Thanks,

    Rich

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Rich Guest

  2. #2

    Default Re: how to suppress "warning null value..."

    SET ANSI_WARNINGS OFF

    --
    David Portas
    ------------
    Please reply only to the newsgroup
    --

    "Rich Protzel" <com> wrote in message
    news:phx.gbl... 


    David Guest

  3. #3

    Default how to suppress "warning null value..."

    If you SET ANSI_WARNINGS OFF at the beginning of the
    procedure the warning will not appear. From BOL...

    ANSI_WARNINGS
    When set to ON, errors or warnings are issued when
    conditions such as "divide by zero" occur or null values
    appear in aggregate functions. When set to OFF, no
    warnings are raised when null values appear in aggregate
    functions, and null values are returned when conditions
    such as "divide by zero" occur. By default, ANSI_WARNINGS
    is OFF.

    --Angel
    -----------------------------------
    Every time I lose my mind, I wonder
    if it's really worth finding.
     
    yzer which 
    other SET 
    not the items 
    the sp adds them 
    null warning 
    results. Is there a 
    *** 
    AngelWPB Guest

  4. #4

    Default Re: how to suppress "warning null value..."

    Set your session property:

    SET ANSI_WARNINGS OFF

    If you are using QA, it will set this option on by default for every new
    connection but you configure that by going to Tools/Options/Connection
    Properties and uncheck the checkbox next to set_ansi_warnings.

    HTH

    "Rich Protzel" <com> wrote in message
    news:phx.gbl... 


    Amy Guest

  5. #5

    Default Re: how to suppress "warning null value..."

    Thank you all for your replies. That did the trick. My sp does not do
    a divide/0, but it does return null values which are OK for my purposes.

    Rich

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Rich Guest

Similar Threads

  1. Replies: 2
    Last Post: October 4th, 09:47 PM
  2. cfqueryparam ignores null="yes" when list="yes"
    By Matt W. in forum Coldfusion Database Access
    Replies: 1
    Last Post: April 22nd, 07:51 PM
  3. "Case when" and "is null" giving me fits
    By lusciousmango in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: January 9th, 11:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139