I have a table with 20 columns, where column 2 is an ntext, and it contains 133 comma separated 'fields'. How do I read the 19 columns and include in the output, the 133 columns from the ntext column.
I am using SQL 2008 and my query is a simple SELECT all columns from tablename using SQL Server Management Studio. What I am trying to achieve is that when columns 1 and 3 thru 19 are returned, I would also like returned the 133 'columns' that are stored within the second column [CSV]. SQL below:
SELECT TOP 1000 [ACL]
,[CSV]
,[EMPLOYER_ABN]
,[EMPLOYER_ID]
,[EMPLOYER_NAME]
,[FD_SS_CONTRIBUTIONS_REP_KEY]
,[MEMBER_ADDRESS_LINE_1]
,[MEMBER_ADDRESS_LINE_2]
,[MEMBER_ADDRESS_LINE_3]
,[MEMBER_ADDRESS_LINE_4]
,[MEMBER_ADDRESS_USAGE]
,[MEMBER_CLIENT_IDENTIFIER]
,[MEMBER_COUNTRY]
,[MEMBER_DOB]
,[MEMBER_EMAIL_ADDRESS]
,[MEMBER_EMPLOYMENT_END_DATE]
,[MEMBER_EMPLOYMENT_END_REASON]
,[MEMBER_FAMILY_NAME]
,[MEMBER_GENDER]
,[MEMBER_GIVEN_NAME]
,[MEMBER_ID] FROM [Sonora].[dbo].[FD_SUPERSTREAM_CONTRIBUTIONS]