Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

need the proper objects identified for creating a re-usable dynamic pivot ?func?

$
0
0

All the dynamic pivot info i run into is just qry code, which is not how my users normally consume this data. This is not something I can change, views are the coin of the realm at present for this department of scientists.

I want to make this dynamic pivot ?function? a reusable object to use in several different views.

So I would like some guidance on the best/most appropriate objects i should create to produce the functionality.

I want a ?function? that i pass the variables of view name and row to be pivoted so it will return a string that gives the distinct column names to use in the pivot.

BELOW is my first attempt, but I figure I'm so far off base I would ask for some high level guidance on what objects should i put each piece of the puzzle in.

CREATE FUNCTION udfprocTest(@View varchar(max),@Column varchar(max))

RETURNS varchar(MAX)

AS

...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>