April 18, 2013 at 10:08 pm
have situation where i need to create a procedure that uses another table data and fetches each table row and passes them as variables into the following user defined function (dbo.Split)
The values id,SID,DOB are getting from another table columns values
Soure table has
ID ColNAME
1 SID,DOB
2 SID,DOB
3 NAME,CITY,ZIP
4 NAME,CITY,ZIP
i need to use variables to fetch each row and pass them into the below function
in the below mentioned function SID and DOB whould be passed as a variables from the source table
select id, SID, DOB
into table1
from
(
select t.id,
c.colname,
c.colvalue
from yt t
cross apply dbo.split(t.name, t.text, ',') c
where c.colname in ('SID', 'DOB')
) src
pivot
(
max(colvalue)
for colname in (SID, DOB)
) piv;
select *
from table1
Can some one please help me
April 18, 2013 at 10:26 pm
I wish I could help you, but I don't understand what you're trying to do.
Please take a look at the article linked in my signature to obtain better help.
April 19, 2013 at 2:55 am
Luis Cazares (4/18/2013)
I wish I could help you, but I don't understand what you're trying to do.Please take a look at the article linked in my signature to obtain better help.
It makes sense if you see this thread too, Luis.
I don't see much point in following this potential solution until others have been considered first.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply