下記は、Selectした結果とOutputパラメーターの両方を取得する例。
@Type bigint,
@AllCnt bigint OUTPUT
AS
BEGIN
Id, Name
FROM
[tUser]
WHERE
[Type] = @No;
@AllCnt = Count(*)
FROM
[tUser]
WHERE
[Type] = @Type;
{
ParameterName = "@AllCnt",
SqlDbType = SqlDbType.BigInt,
Direction = ParameterDirection.Output
};
.FromSql("EXECUTE dbo.spUserSelect @Type, @AllCnt OUTPUT",
new SqlParameter("@Type", type),
paraAllCnt).ToList();
最近のコメント