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
...