Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32062

Fetch values from Comma Seperated Columns in SQL SERVER

$
0
0

I have a a table that store values like this:

Name      CategoryId

Gaurav    4,6

Amit      2,4

Ajay      6,2  

2,4,6 (This is the id of category that name is present in their master table)


The Master table of category like this.

Id  CategoryName

2   Motor

4   Scooter

6   Car

I want to fetch all the records from the table first, and want to category name ( not the category id).

Name       CategoryName

Gaurav     Scooter, Car

Amit       Motor, Scooter

Ajay       Car, Motor

How this is done through Stored Procedure...


Viewing all articles
Browse latest Browse all 32062

Trending Articles