Method 1:
To use this method we will use the following posts
1. Function that Splits string in SQL Server / Table Valued Function
2. Create Temp Table in Sql Server or Create Temp Table Variable in Sql Server
3. Difference between #Table and @Table in sql server
OUT PUT: