T-SQL Help please

Hi Spunkey - there is an identifier however the number of records can vary - my example shows 2 for each 'contact record' however there can be between 1 and 100 (or more!).

Speed isnt' an issue as it's a one-off + I'm running it againt a data warehouse so won't effect prod.

Cheers.
 
Hi Simon - I've tried your code and get the following:

Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@ret".
Msg 1087, Level 15, State 2, Line 6
Must declare the table variable "@temptable"
 
Sorry I assumed you knew how to write the cursor code.
Bear with me and I'll write the rest.
I attended an advanced t-sql course a few weeks back which covered cursor and scalar functions (and how not to use then ;-))

Forgotten most of it as I rarely use it! Really appreciate the help though :)
 
Back
Top Bottom