Hi guys
I using SQL Server 2008R2 and need to convert a vertical table (Key-Values pairs) into a standard looking SQL Server table.....
The data comes into the db like this
ReportDumpId Int Indentity
ReportId Int
KeyName NVARCHAR(2000)
KevyValue NVARCHAR(2000)
KeyType NVARCHAR(255)
and a sample of the data:
ReportDumpId ReportId ItemId KeyName KeyValue KeyType
756 49415 2237099 referencenumber 2237099 notype
757 49415 2237099 referencenumberusrprefix USR2237099 notype
758 49415 2237099 category Academic (professor, student, researcher) notype
759 49415 2237099 attendeerecordurl https://www.eiseverywhere.com/ereg/r...QOt757xQ%3D%3D attendee
760 49415 2237099 registered 2011-07-19 notype
761 49415 2237099 registereddateandtime 2011-07-19 12:20:56 notype
762 49415 2237099 registeredby attendee notype
763 49415 2237099 registrationstatus Confirmed notype
764 49415 2237099 approvalstatus Approved notype
765 49415 2237099 modified 2011-07-19 notype
What I ultimatlely need is something that looks like this:
ItemId referencenumber referencenumberusrprefix and so on....
2237099 2237099 USR2237099
Any one got any ideas?
I was thinking of a cross tabl but can't seem to get my head around it.




Reply With Quote