I created a stored procedure... and when I execute it in the sql managment studio I get the data I was expecting. But when I execute it through TSQL in code I get back an empty row for each row in the table, 17,000 records and not the results I see in management studio. I think this is because I have multiple selects in my SP, how do I get around this? (I was watching in the profiler and saw it returned 17,000 whatever rows both when executed in management studio and code)
Thanks for the help,
Dan
Code:
BEGIN SELECT * INTO #Temp FROM zCIFRecord AS C WHERE InsertTime = (SELECT MAX(InsertTime) FROM zCIFRecord WHERE CIFPan = C.CIFPan) SELECT CIFPan, CIFMemNum, CIFLName, CIFFName, CIFInitial FROM #Temp WHERE ((CIFAcctNum1 IS NULL) OR (LEN(LTRIM(CIFAcctNum1)) = 0)) AND ... AND ((CIFAcctNum17 IS NULL) OR (LEN(LTRIM(CIFAcctNum17)) = 0)) DROP TABLE #Temp END
Dan
Comment