I have a C# CLR doing multiple string manipulations. It returns an int. I'm calling it with
SELECT func(col1, col2) AS Score
INTO #A
FROM table;
SELECT *
INTO #B
FROM #A
WHERE Score > -1
If I do something like
SELECT func(col1, col2) AS Score
INTO #A
FROM table
WHERE func(col1, col2) > -1;
Is the CLR called and executed two times? In terms of performance/speed is there a better way to get the same result?
col1 is nvarchar(max), col2 is nvarchar(800). The function contains business logic.
There are about 10 billion rows/calculations