DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   Read row in a CLR Stored Procedure Without output parameter (http://www.daniweb.com/forums/thread115837.html)

culebrin Mar 26th, 2008 3:32 pm
Read row in a CLR Stored Procedure Without output parameter
 
Hi all,

I have a Stored Procedure without an output parameter but it returns one row always, this SP is called by another SP, so I need to store some of those columns in a variables of the first SP. How can I do that?

Please help.

P.D.: I have no access to the code of the first SP, and is a CLR, HEEELPPP!!!

huangzhi Apr 1st, 2008 11:34 pm
Re: Read row in a CLR Stored Procedure Without output parameter
 
Hope this code can help you.

1. Execute your first SP in query analyzer to show the columns list.

2. Create temporary table and the field must the same as first SP columns
create table #tmpTemp (
  Field1 varchar(255),
  Field2 varchar(255))

3. Insert the columns from first SP into temp table.
insert #tmpTemp exec sp_SP1

4. Store the column value.
declare @Field1 varchar(255)
select @Field1 = Field1 from #tmpTemp


All times are GMT -4. The time now is 5:16 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC