dbx driver version 5.0.2
delphi2006
MSSQL 2000 (works fine on 2005 and 2008)
EnableBCD=True //Have to be true, we are using this
SP Sample
ALTER PROCEDURE [dbo].[GetPrice] @PriceOK real OUTPUT, @PriceExcCause smallmoney OUTPUT AS
SET @PriceOK = 100
SET @PriceExcCause = 100
Delphi code:
with TSQLStoredProc.Create(Self) do
begin
SQLConnection:= ASQLConnection;
SchemaName := 'dbo';
StoredProcName := 'GetPrice';
Prepared := True;
ExecProc;
end;
Exception
_Database Server Error:_SQL Error Code:_257
Implicit conversion from data type varchar to smallmoney is not allowed. Use the CONVERT function to run this query.
the call extracted from Profiler:
declare @P1 varchar(67)
set @P1=NULL
declare @P2 varchar(67)
set @P2=NULL
exec dbo.GetPrices @P1 output, @P2 output
select @P1, @P2
Have checked the params after prepare in delphi. They are of ftFMTBcd type. Why is this type suddenly converted to varchar and only on MSSQL 2000? Is that a bug? Any known workaronds?