Page 1 of 1

NHibernate: Stored procedure parameter issue

Posted: Fri 12 Oct 2012 09:21
by vatirim
Using Entity Developer 4.7 with NHibernate 3.3.1 and SQL Server 2008 (dialect=NHibernate.Dialect.MsSql2008Dialect) I want to call stored procedures.
The generated command in the <sql-query> element of the hbm.xml file contains a call syntax which is not accepted by NHibernate.
I get sth like this:

Code: Select all

exec dbo.MyProc(:Param1, :Param2)
I would expect a syntax without parentheses.
NHibernate returns an error like this:

Code: Select all

[SQL: exec dbo.MyProc(@p0, @p1)] ---> System.Data.SqlClient.SqlException: Incorrect syntax near '@p0'.
What am I doing wrong?

Re: NHibernate: Stored procedure parameter issue

Posted: Tue 16 Oct 2012 09:22
by Shalex
We have reproduced and are investigating the issue. We will post here about the results.

Re: NHibernate: Stored procedure parameter issue

Posted: Wed 17 Oct 2012 09:19
by Shalex
The bug with generating SQL for invoking stored procedure is fixed. We will post here when the corresponding build of Entity Developer is available for download.

As a workaround, please switch to the SQL execution and set a correct syntax manually:

Code: Select all

exec dbo.MyProc :Param1, :Param2

Re: NHibernate: Stored procedure parameter issue

Posted: Thu 18 Oct 2012 16:22
by Shalex
New build of Entity Developer 4.7.285 is available for download!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=25093.