Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9046495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:40:17+00:00 2026-06-16T11:40:17+00:00

How does one use the debugger in sql 2008 / 2012 to catch null

  • 0

How does one use the debugger in sql 2008 / 2012 to catch null values in records?

See:

drop table abc

create table abc(
a  int
)
go 
insert into abc values(1)
insert into abc values(null)
insert into abc values(2)

select max(a) from abc

(1 row(s) affected)
Warning: Null value is eliminated by an aggregate or other SET operation.

Now this can be rectifed by doing:

SELECT max(isNull(a,0)) FROM abc

which is fine, until I come to to 200 line queries with several levels of nesting,and a result set of 2000 odd records. — And then have no clue which column is throwing the warning.

How do I add conditional breakpoints ( or break on warning ) in the SQL debugger? ( if it is even possible )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:40:18+00:00Added an answer on June 16, 2026 at 11:40 am

    Part 1: About aggregate warnings…
    Considering your several levels nesting I am afraid there is no straightforward way of seeing which records trigger those warnings.

    I think your best shot would be to remove each aggregate function, one at a time, from the SELECT part of the top-level statement and run query so you can see which aggregate is causing warnings at the top level (if any)

    After that you should move on to nested queries and move each sub-query that feeds the top-level aggregates to a separate window and run it there, check for warnings. You should repeat this for additional levels of nesting to find out what actually causes the warnings.

    You can employ the following method also.

    Part 2:About conditional breakpoints…
    For the sake of debugging, you move each of you nested tables out and put its data to a temp table. After that you check for null values in that temp table. You set a breakpoint in an IF statement. I believe this is the best thing close to a conditional breakpoint. (IF clause can be altered to build other conditions)

    Here is a solid example,
    Instead of this:

    SELECT A.col1, A.col2, SUM(A.col3) as col3
    FROM (SELECT X as col1, Y as col2, MAX(Z) as col3 
          FROM (SELECT A as X, B as Y, MIN(C) as Z
                FROM myTableC
               ) as myTableB
         ) as myTableA
    

    do this:

    SELECT A as X, B as Y, MIN(C) as Z
    INTO #tempTableC
    FROM myTableC
    
    IF EXISTS (SELECT * 
               FROM #tempTableC
               WHERE A IS NULL ) BEGIN
         SELECT 'A' --- Breakpoint here
    END
    
    
    SELECT X as col1, Y as col2, MAX(Z) as col3
    INTO #tempTableB
    FROM #tempTableC
    
    IF EXISTS (SELECT *  
               FROM #tempTableB
               WHERE X IS NULL ) BEGIN
         SELECT 'B' --- Breakpoint here
    END
    
    SELECT col1, col2, SUM(col3) as col3 
    FROM #tempTableB as myTableA
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does one use rm to delete a file named '--help'? When I try,
How does one use multiprocessing to tackle embarrassingly parallel problems ? Embarassingly parallel problems
how does one use code to do this: produce 15 random numbers [EDIT: from
How does one use boost::spirit with an input that consists of something other than
How does one use the CGRectIntegral function? I understand it's purpose. The documentation isn't
It does not seem that SendGrid has a free account that one could use
In .net, does a bool[] use one bit or one byte per array item?
How does one use QFileSystemModel in the context of a QCompleter ? It looks
What is X.509? How does one use it in REST web service for authentication?
does one perform better over the other in terms of indexing/quering etc ? e.g.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.