Freek's Blog

SQL en .NET vraagstukken en oplossingen die ik zoal tegenkom
posts - 199, comments - 123, trackbacks - 2, articles - 7

My Links

News

Google analytics script: Locations of visitors to this page

Article Categories

Archives

Post Categories

Image Galleries

Algemene links

MSDN

vb links

t-sql: return value from stored procedure

Posted on Thursday, November 04, 2010 10:00 AM

method1

create procedure ProdTest @trigger as int, @test varchar(15) output
as
begin
if
@trigger = 0
begin
set @test = '0 result'
end
else
begin
set @test = '1 result'
end
end

----------------------

declare @getOuputValue as varchar(20)
execute dbo.ProdTest 0,@getOuputValue output
select
@getOuputValue

----------------------

0 result

 

 

 

 

method2

ALTER PROCEDURE test99 (@input varchar(10))
AS
BEGIN
SET NOCOUNT ON;
select @input, @input
END
GO

------

exec test99 'halo'

---------

 

(No column name) (No column name)
halo                       halo

 

 

Post Comment

Title  
Name  
Url
Comment   

ATTENTION: the code you need to copy is CaSe SeNsItIvE and is required to prevent spam.
Enter the code you see: