Use of SplitArray/utility.Number

Aug 25, 2011 at 2:40 PM

As far as I can see the SplitArray function and table is used to test for the existence of a given column in the @capturedColumnList variable in the stored procedure sp_StandardCDC_enable_table at line 132

AND (c.name IN(SELECT cc.Element FROM utility.SplitArray(@CapturedColumnList, ',') AS cc) OR @CapturedColumnList IS NULL)

This test can be replaced with;

AND (CHARINDEX(','+c.name, ','+@CapturedColumnList) > 0  OR @CapturedColumnList IS NULL)

which is probably faster (though performance is not an issue here) and removes the need for the 12.5Mb utility.Number table

Regards

Derek