Iron Chef SQL (7/29/2009)
for some reason my if condition (to test if NULL then INSERT) inserts data no matter what.
I'm trying to figure out why but maybe it's something simple and another pair of eyes can see what I can't
Maybe that's because both segments of your conditional insert data.
I have to agree with the others that a cursor is not the way to go with this. It's horribly inefficient.
As I said earlier you should also look at using IF EXISTS or IF NOT EXISTS, unless you're purposely trying to write inefficient code.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA