Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Convert String of ID's to a string of names

$
0
0

Thanks in advance for any help on this question...

I have a string that contains ID's separated by a '/' character (e.g. '/12/1546/34/156/').

I want a query that can look up each of these id values in a table and return the entries Name (so i get a string that looks like this - '/name 1/name 2/name 3/name 4/').

Table Name = COMPONENTS

Table Columns = id, name

I could do this in a very round about way - split the string into id values, insert values into a temp table of some sort, match temp table values against records in the Components table and then convert the names back into a string but I'm sure there must be a better way of doing it...

Thanks,

Jake


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>