这有多难?文档对此无用。
我想在sql server中使用带参数的存储过程删除,但每次都会出错。
ALTER PROCEDURE [dbo].[usp_DeleteFeed]
@DateFrom datetime
AS
BEGIN
SET NOCOUNT ON;
DELETE FROM dbo.tblFeed WHERE DateUpdated < @DateFrom
SET NOCOUNT OFF
END
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<sql-query name="dbo.usp_DeleteFeed">
exec dbo.usp_DeleteFeed @DateFrom=:DateFrom
</sql-query>
</hibernate-mapping>
_feedRepository.Session.GetNamedQuery("dbo.usp_DeleteFeed").SetParameter("DateFrom", dateFrom).ExecuteUpdate();