sql server - Efficient SQL query for two updates and search queries -


I have such a query:

  SELECT TOP 1 ID, data, Other acknowledged date = @DATE  

After reading and using line data, I want to update that retrieval line and change it to a single column. (In other transactions).

But as you see here I have searched for that line twice, is there any way that I remember the line and update without searching again.

Thank you.

I know its prevalent information but you can also update the status on the cursor.

  Use EMP_CURSOR Cursor to go to Northwind For the top 1 employee, the last name for the employee, where the final name for OpenData = '1 994-11-15' is open for updates EMPCRORATOR Eager EMPPORTS Update next to employee Employee NextName LastName = LastName + CAST (Datestart (MS, GateDate)) EMP_CURSOR EMP_CURSOR DEALLOCATE EMP_CURSOR  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -