Wednesday 15 April 2015

How to check if a specific record exists in a table in SQL Server? -


I have to check whether a record exists with the ID10 in the <10> user table is.

I was trying to use the exists keyword in SQL, but I can not understand the correct syntax to ensure exists to check it For whether a record exists or not.

I want something like the bottom

  if (exists (select ID from ID * where id = id)) {}   < / Div> 

Existing is easy to use the keyword, I have written the correct syntax below, check it < / P>

  if present (select from [dbo] * [table] where id = [the id that you want to see]) Choose 'right' and choose 'false' return    

No comments:

Post a Comment