5 thoughts on “ADO – Stored Procedure – Generated SQL


  1. Good point, Peter Joseph – Also just rediscovered that we have no less than five methods of firing stored procs in our wrappers, all processing arguments in different ways.

    Like


  2. Double-check the parameters datatype: we had this problem when the parameter was interpreted as a double and not as a TDateTime. During the call, the date was converted to float, passed to the server  as a float and re-converted to a sql datetime. This leads to the 2 day offset, since in delphi TDateTime(0) = ‘1899-12-30’ and in mssql cast(0 as datetime) = ‘1900-01-01’ 

    Like


  3. Giacomo Degli Esposti – That was indeed the problem.  What fixed it was formatting the date as a string in the format that the db was set up for.  The developer said “Don’t tell anyone” as  this was the method used numerous other places in the code 🙂  The underlying cause appears to be that TDateTime turns to Double in a Variant array.

    Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.