• Dave Ballantyne (12/11/2009) CLR routines are again (over)used by non-set based mindset developers.

    But if the requirements are not "set-based" or "column-based" ....

    For example, if the ROW (condition) then select col_A as @vrbl_X, col_B as @vrbl_Y

    else, select L, M, N, O, P, Q, ...V and arrange them into several lines of a flat file according to X12 rules, inserting @vrbl_X, @vrbl_Y, and other globals at the appropriate places, and updating the globals conditionally as you go along.

    Sure, a stored procedure CAN do it, but a script component or other CLR is easier. Especially when the DB is read-only and you can't stick a sproc into it!