Jump to content

SQL query results


ORSO2001

Recommended Posts

Dear All,

I am starting for the first time to work with DB in a server PC using SQL (SQL server) query.

I am using the SQL example...all works fine...I do the connection...I create the table...I am able to insert, update, get and cancel the "info" with this DB...what I saw and I don't understood is that if I send a query to have some information refered at a specific ID (...WHERE employeID =?) and this ID is not present in the DB the query result, BIT about query success, is turned as "1" ...I was expecting that the "fail BIT" arise !?

Maybe this is correct, sorry I don't know deeply this matter...can someone confirm?

thanks

Link to comment
Share on other sites

Well, from the point of view of the SQL Server / Client or the query, it succeeded (there query itself had the right syntax, and the tables and columns existed).

We don't parse the queries you execute, so we don't know what is going to be returned. 0 records doesn't mean fail, since "Delete From Table" would return 0 records, but is still OK.

Link to comment
Share on other sites

hi Saragani,

thanks for the answer...yes obviously you are right...thinking better I understood that I am asking to search if some element has a specific ID and the answer is "no one item has this ID"...then the request is done in correct way and also the answer is back in the correct format...thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...