I am using MS SQL Server 2008 and I need to create a view from values in a table.
The table the view will pull its data from has a column that contains values which are separated by commas. For example the information in one field in this column might be: 123kdkd, 2939439
I want to take each value that is in the field and put it into one field in the view. So if I were to do this for the sample data I provided, my view would look like this
----------- | -----------
1 | 123kdkd
2 | 2939439
I think I might need to use the charindex() and substring() functions and do a loop, but I am new to T-SQL and haven't done a loop in SQL before.