Please help with creating a view between two tables and a column that needs to be parsed.
All, please help me with this since I am new to SQL Server but I'm trying to create a view where one column from a table needs to be parsed out and then related to another table.
Please note data from first table is shown as follows: (I provided an Excel document as well in attachments.)
Code Label
DC DATA CENTER
99 PERSONAL
RE REIMBURSABLE
IT INFO TECHNOLOGY
TE THEATER
ST STAFF
SC SECURITY
PM PROJECT MANAGEMENT
MK MARKETING
CA CADD
AV AUDIOVISUAL
AT ACCOUNTING
AC ACOUSTICS
00 GENERAL
¿ME MEDICAL EQUIPMENT
So basically the Org column that has colons separating contains the code in the 2nd table at the end. As an example the US:06:AV actually points to AV for AUDIOVISUAL in the 2nd table.
Thus I'm trying to create a view that gives WBS1, WBS2 and then a description of that code tied together in a relationship. This would be a lot easier if there was a column that only had the AV code but in this case I'm having to parse it out and then use it as such in a relationship. Then I have to take it a step further and if there are multiple disciplines show in a comma separated way.
How do I go about creating a view that as my example would show as the following?
WBS1 Discipline
23 ACOUSTICS
5793 AUDIOVISUAL
9413 REIMBURSABLE
9414 GENERAL
9414 ACOUSTICS, GENERAL
9415 ACOUSTICS, REIMBURSABLE
9416 GENERAL
9455 INFO TECHNOLOGY
9456 GENERAL
Again, please note attached Excel file with its 3 sheets as to what I'm trying to do.