Avoid using cursor, if primary key is on the working table, in some cases, we can achieve cursor functionality with following
declare @currid int
select @currid = min(OrderID) from Orders where OrderDate < ''7/10/1996' while @currid is not null begin select @currid = min(OrderID) from Orders where OrderDate < '7/10/1996' and OrderID > @currid
end
May be helpful in some cases..
Thursday, January 10, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment