如何修改 存储过程 返回类型
sql
create procedure ForDerive (@int int, @nvarchar nvarchar(10), @numeric numeric)
c#
using (SqlConnection con = new SqlConnection(cs))
{
con.Open();
SqlCommand cmd = new SqlCommand("ForDerive", con);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
SqlCommandBuilder.DeriveParameters(cmd);
foreach (SqlParameter p in cmd.Parameters)
{
Console.WriteLine("{0} - {1}", p.ParameterName, p.DbType);
}
con.Close();
}
Output:
@RETURN_VALUE - Int32
@int - Int32
@nvarchar - String
@numeric - Decimal
提问:
@RETURN_VALUE - Int32,这里默认返回类型是int,要如何才能修改为其他类型,比如 nvarchar(10)
------解决方案--------------------