News
FROM statement using source data that's known to have flaws. Back to the OP - either filter out the bad records in the WHERE clause, or put a CASE statement in the UPDATE list. No need for a cursor.
I'm doing this in a stored proc using SQL Server.<BR><BR>Basically, I'm executing 1 SELECT statement and if that returns any rows then I want to do a SELECT INTO #Temp With criteria A.
SQL Server has an optimizer that usually does a great job of optimizing code for the most effective execution. A query execution plan is the breakdown of how the optimizer will run (or ran) a query.
Results that may be inaccessible to you are currently showing.
Hide inaccessible results