Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    SF, CA, USA
    Posts
    1

    Unanswered: A Question About Detecting ANSI_WARNINGS Warnings

    Hi,

    I have a question about ANSI_WARNINGS and how to detect them. If I execute the following query in Query Analyzer:

    SET ANSI_WARNINGS ON
    SELECT SUM(pubs..discounts.lowqty) FROM pubs..discounts

    I see the warning, as expected:

    -----------
    100

    (1 row(s) affected)

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

    Is there a place on the server (or, client) where this is logged? (The assumption should be that users won't be using Query Analyzer to execute SQL like this, so, of course, they wouldn't see the warning text.)

    As for the OLE DB code, the HRESULT from executing this SQL is 0 (S_OK). Is there any programmatic way of detecting this warning so that I may log to a file, etc.?

    TIA

  2. #2
    Join Date
    Jul 2002
    Location
    India
    Posts
    13

    Smile

    I hope u need to specify ANSI_Warnings OFF


    Balaji

Posting Permissions

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