I am needing to convert a large amount of SQL queries into stored procedures. I have some code that updates about 20 or 30 values at one time in one Delphi procedure. I can
ADO will create the parameters for you, you just need to call Refresh on the parameters object:
SP.Connection := SqlConnection; // must be done before setting procedure name
sp.ProcedureName := 'MyStoredProc';
sp.Parameters.Refresh; // This will create the parameters for you as defined in SQL Server
sp.Parameters.ParamByName('@SSN'').Value := SSN; // params now exist
etc
If any parameters are output you will need to set them explicitly:
sp.Parameters.ParamByName('@ReturnValue').Direction := pdInputOutput;