Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder complete's Avatar
    Join Date
    Jul 2005
    Location
    USA
    Posts
    87
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Is there a way to find out if a query will return data before it is made?

    Is there a way to find out if a query will return data before it is made?

    I have an unusual problem. My code uses a 3rd party dll to make database calls from my silverlight client to a sql server database. In my code, I make dozens of calls one after the other. All of the calls execute successfully. But sometimes the result of a successful call is an empty data set. Is there any way I can modify my call so that in the return will tell me what call was made that returned the empty data set?

    The 3rd party software pretty much returns whatever command I give as a query I test in Microsoft Server Management Studio. Is there some sort of SQL command that will test if some sort of SELECT statement will return data and can that return statement contain the ID's or parameters used to make the statement?

  • #2
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,994
    Thanks
    120
    Thanked 76 Times in 76 Posts
    3rd party software pretty much returns whatever command I give as a query
    log your query & result into separate table forinstance
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    I'm mystified.

    If a given query doesn't return any data today, that doesn't mean it won't tomorrow (or 30 seconds from now or...) when new data is added to the database.

    So usually, the way to find out if a query will return data is...run the query and find out.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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