Google+ Tools
Make Google+ profile picture
Make Google plus banners for profile
Create and share your Google Plus profile banners.

Profile image for mrk studios Rob Horton on February 18, 2011
I hate cursors. A lot. They are bloated, complex, and use entirely too much code. I get it though. Sometimes you just have to use them. And I get it that they have their place. Cool. Here is way to not use one though.
Language
SQL
Tags

SQL Tips - Cursorless Cursor


declare @icount int
declare @rows int

set @icount = 0 
set @rows = (select count(*) from @temptable)

while @icount <= @rows - 1
begin
	'do processing here
	'here you can evaluate each row in your temptable where it's identity col matches the current icount var
	set @icount = @icount + 1
end

Comments

blog comments powered by Disqus