| 
	
 | 
 Posted by Chris on 06/07/06 14:07 
Hi, 
 
I created a VB SQL CRL Stored procedure for calculating a value. Value 
is returned as below 
 
    Using sConn4 As New SqlConnection("context connection=true") 
      sConn4.Open() 
      scmd = New SqlCommand("SELECT " & var_max, sConn4) 
      sdrd = scmd.ExecuteReader() 
      SqlContext.Pipe.Send(sdrd) 
    End Using 
 
When calling this stored procedure from a TSQL stored procedure for 
using the value for further processing the value returned to my 
variable is 0. The correct value should be 56. In results tab I get the 
correct result, but how can I assign it to my variable @max ? 
 
DECLARE @max1 int 
DECLARE @max int 
 
EXEC @max1 = [dbo].[VBSTP_calculate_MAX_no] 
	@vsp_table_name = N'[dbo].[Message]', 
	@vsp_table_key = N'message_no', 
	@vsp_WHERE = N'' 
 
print @max1 -- value here is 0 
 
SET @max = (SELECT @max1) 
 
Thanks a lot.
 
  
Navigation:
[Reply to this message] 
 |