Home Dashboard Directory Help
Search

parameters are passed null when using multiple uda aggregate (clr) in pivot statement by mordechai.p


Status: 

Resolved
 as Won't Fix Help for as Won't Fix


1
0
Sign in
to vote
Type: Bug
ID: 795206
Opened: 7/28/2013 5:41:44 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description




parameters are passed null when using multiple uda aggregate (clr) in pivot statement
and cant pass constantly .

there is a full example in attached file




SELECT * INTO #tmp1 FROM (
SELECT 2 AS Id,1 AS GroupId ,2 AS columnId ,'b' AS Name    UNION ALL
SELECT 4,1,4,'d'
UNION ALL
SELECT 3,1,1,'c'
UNION ALL
SELECT 1,1,1,'a'
UNION ALL
SELECT 5,2,1,'e'
UNION ALL
SELECT 7,2,3,'g'
UNION ALL
SELECT 8,2,4,'h'
UNION ALL
SELECT 6,3,2,'f'
UNION ALL
SELECT 9,2,3,'j'
UNION ALL
SELECT 10,2,4,'i'
UNION ALL
SELECT 11,3,2,'k'
) AS q

SELECT *
FROM    #tmp1

SELECT GroupId,
dbo.SortedConcat(NAME, '-', Id),
dbo.SortedConcat(NAME, '-', Id * -1)
FROM    #tmp1
GROUP BY GroupId

SELECT *
FROM    ( SELECT    GroupId,
columnId,
Name
FROM     #tmp1
) AS sourceTable
PIVOT ( Dbo.SelfSortedConcat(sourceTable.Name) FOR columnId IN ( [1],
[2], [3], [4] ) )
AS pivotTable
--SELECT *
--FROM    ( SELECT    GroupId,
--columnId,
--Name
--FROM     #tmp1
--) AS sourceTable
--PIVOT ( Dbo.SortedConcat(sourceTable.Name,',',Id-- syntax error
--FOR columnId IN ( [1],
--[2], [3], [4] ) )
--AS pivotTable
SELECT *
FROM    ( SELECT    GroupId,columnId,Name,',' Delimiter,0 AS Id
FROM     #tmp1
) AS sourceTable
PIVOT ( Dbo.SortedConcat(sourceTable.Name,Delimiter,Id)-- parameters 'Delimiter' and 'Id' passed as null and cause an exception
FOR columnId IN ( [1],[2], [3], [4] ) )
AS pivotTable

DROP TABLE #tmp1
Details
Sign in to post a comment.
Posted by Microsoft on 7/31/2013 at 7:38 PM
Thank you for submitting this feedback. After carefully evaluating all of the bugs in our pipeline, we are closing bugs that we will not fix in the current or future versions of SQL Server.
Thanks again for reporting the product issue and continued support in improving our product.
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
UdaPivotExample.sql 7/28/2013 19 KB