[dba-VB] Parameter objects in C# and ADO.

Stuart McLachlan stuart at lexacorp.com.pg
Thu Nov 26 04:26:58 CST 2009


SP with a parameter that is both Input and Output

In some situations, there is no need to store the output into an extra variable because the 
output must replace the input.

CREATE PROCEDURE cap2 (@name NVARCHAR(20) OUT )
--Capitalizes first char, changes the rest to lower case
--SP with one input/output parameter
AS
SET @name=UPPER(LEFT(@name,1))+LOWER(RIGHT(@name,LEN(@name)-1))

or for you .net types, see
http://fabioscagliola.spaces.live.com/blog/cns!919F8FCDE3DC9AC4!121.entry

-- 
Stuart


On 26 Nov 2009 at 9:04, Mark Breen wrote:
> 
> afaik, a param can be input  (the default direction) or output.  I have not
> heard of an inputoutput param so unless anyone here says different, assume
> that you cannot have bi-directional.
> 




More information about the dba-VB mailing list