Passing SQL Server stored procedure parameter names via Delphi

前端 未结 1 1146
小蘑菇
小蘑菇 2021-01-15 05:47

I\'m new to Delphi and trying to find my way around calling some stored procedures in SQL Server.

This is the code I have been working with at the moment and it work

相关标签:
1条回答
  • 2021-01-15 06:15

    You can do what you want if you use TADOQuery instead of TADOStoredProc.

    FMetaDataSP := TADOQuery.Create(nil);
    FMetaDataSP.Connection := FConnection;
    FMetaDataSP.SQL.Text := 'Messaging.ListMessageSections @ReferralID=:ReferralID, @ConsumerID=:ConsumerID';
    
    FMetaDataSP.Parameters.ParamByName('ReferralID').Value := ReferralID;
    FMetaDataSP.Parameters.ParamByName('ConsumerID').Value := ConsumerID;
    FMetaDataSP.ExecSQL;
    
    0 讨论(0)
提交回复
热议问题