Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sravan.here
Starting Member
4 Posts |
Posted - 2013-04-19 : 00:04:14
|
Hi,I have situatuion where i need to create a proceduer 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 the getting from another table columns valuesSoure table hasID ColNAME 1 SID,DOB2 SID,DOB3 NAME,CITY,ZIP4 NAME,CITY,ZIPi need to use variables to fetch each row and pass them into the below functionselect id, SID, DOBinto table1from( 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')) srcpivot( max(colvalue) for colname in (SID, DOB)) piv;select *from table1Can some one please help me |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-19 : 02:58:51
|
hmm...i dont think you need a cursor for this. why not do it in a set based manner?If you tell us full requirement by means of sample data and output, we can help you out.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
|
|
|
|
|