March 21, 2006 at 5:25 am
Trying cursors out for the first time. I know do it a different way; however this is a one off tool that will never be used again and using a cursor mimicks the logic of the application this tool needs to fix.
I have two cursors in a script. The first cursor executes and the second does not. The logic in psuedo code goes like this:
create global temp table 1
fill table
create global temp table 2
fill table
add columns to global temp 2
declare cursor 1
run cursor 1 against global temp 2 and fill added columns
close and deallocate cursor
add column to global temp 2
declare cursor 2
run cursor 2 against global temp 2 and fill added column
close and deallocate cursor
thanx, for your time and attention
andy
March 22, 2006 at 3:52 am
The pseudocode looks OK at a quick glance. Can you post the actual code? Would be easier to debug.
Why global temp tables?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy