Hi, i need to create a dynamic SQL statement that selects fields based on an XML parameter.
Say i have a stored proc with 1 param - [@FIELDS XML] that contains field names. eg...
Field 1 = Name
Field 2 = Address etc...
..in reality there would be up to 50 fields and i only want to report on the ones in the XML parameter.
how can i make a simple statement like this work..
select
xmlParam1,
xmlParam2,
...
xmlParamN
from TABLE
etc...
NB: the data is coming from a string array in c#.
Thanks!