Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    74

    Unanswered: How to return error code to application

    Good day DB Expert !

    can someone please help me to understand is there a way to return the user defined error string back to .net application ?

    i have following query to check which userrid are NULL
    eg :

    SELECT userid
    FROM USER
    WHERE ISNULL(userid,'') = ''

    if i get the numbers of userid which have null value, then return to aplication though the suggesting way.

    the predefined error string would be something like

    Code:
    The userid that having NULL value : list of userid
    the above Pre-defined error string would like to be return to application, how can i make this happen ?

    appreciated your guidance !

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I am not clear on what you are trying to do, but here is a shot...
    Code:
    SELECT 'The userid that having NULL value : list of userid' 
    FROM USER
    WHERE userid is Null
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jul 2007
    Posts
    50
    I would have thought to would have been easier to do this at the application level, because as I see, returning the list of NUll Users is not an error, SQL Server is doing exactly what it is designed to do, ie return a list of values asked for.
    Check to see if any data has been returned and do your error handling from there.

  4. #4
    Join Date
    Mar 2004
    Posts
    74
    Thank you All, i think that will be good if just send back the list of problematic id back to application instead of sending error msg , thank you for guidance and advice

Posting Permissions

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