Hi, I am trying to implement the CLR function Eric Wahner posted in this Article.
http://qa.sqlservercentral.com/articles/.Net/94922/
Now, I've pushed the assembly to my DB and can see it there.
So far I have tried building an Inline TVF, as I assume this is how it would be used on the DB; however, I am receiving the following error on my code, I must be missing a step somewhere, as I've never done this before. I'm lost on how to implement this clr function on my db?
Error:
Msg 156, Level 15, State 1, Procedure clrDynamicPivot, Line 18
Incorrect syntax near the keyword 'external'.
CREATE FUNCTION clrDynamicPivot
(
-- Add the parameters for the function here
@query nvarchar(4000),
@pivotColumn nvarchar(4000),
@selectCols nvarchar(4000),
@aggCols nvarchar(4000),
@orderBy nvarchar(4000)
)
RETURNS TABLE
AS
return
(external NAME CLRfunctions.RIFunctions.clrDynamicPivot)
GO