http://msdn.microsoft.com/library/de...es_07_3q7n.asp
Below is just a quick example:
CREATE proc dbo.usp_test
@test varchar(100) out
as
set @test = @test + ' World!'
GO
--------------------------------
Connection = new SqlConnection();
Connection.ConnectionString = YOUR_CONNECTION_STRING_GOES_HERE
Connection.Open();
Command = new SqlCommand();
Command.Connection = Connection;
Command.CommandType = CommandType.StoredProcedure;
Command.CommandText = "usp_test";
SqlParameter parm = new SqlParameter("@test", "Hello");
parm.Direction = ParameterDirection.InputOutput;
Command.Parameters.Add(parm);
Command.ExecuteNonQuery();
MessageBox.Show(Command.Parameters["@test"].Value.ToString());
Command.Dispose();
Connection.Dispose();
--
Derek Davis
dd******@gmail.com
"Bjorn Abelli" <bj**********@DoNotSpam.hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
"carion1" wrote... You don't need a second parameter. You can declare the
parameter as InputOutput for SQL Server (maybe for others
as well).
I know it works with Oracle, but is it really true for SPs in SQL Server?
As I have searched for that possibility, I would be happy if you could
provide a link to where I can read about SQL Server having InputOutput
parameters in stored procedures?
// Bjorn A