Using Lazarus 2.04 and running against a 2014 MS SQL server, I have a stored procedure with this signature:
create procedure [dbo].[lst_UserNotifications]
(
@chrUserID varchar(16),
@bitShowComplete bit = 0,
@bitShowIgnored bit = 0,
@bitIgnoreYourOwn bit = 0
)
Using a
- TMSSQLConnection
- TSQLQuery
- TSQLTransaction
and executing
SQLQuery.SQL.Text := 'EXEC lst_UserNotifications ''NHTACCESS'', 0, 0, 0';
query.Active := True;
works fine and delivers the expected result set.
I have had no success using proper parameters no matter what I tried:
With query.ParseSQL = True and no parameter objects
Creating Parameter object via IDE
Specifying the 4 required parameters as in EXEC lst_UserNotifications :chrUserID, bitShowComplete ...' or not
and any imaginable combination...
I usually end up with it not finding the first parameter.
What do I need to do?
Thanks for any help you can give!