Hi everyone

I'm working with the prepared statements and "SQLSetParameter" seems to append a whitespace at the end of each parameter I set. This does not seem to be a problem if I search for a specific ID, but searching for string is annoying.

Here is some pseudo code:
Send SQLPrepare of hstmt "select sometable.someID from sometable where sometable.someOtherID=(?) AND sometable.someField like (?)"

MSSQL 2017 does execute the following statement (SQL profiling for the win):
Code:
declare @p1 int
set @p1=27
exec sp_prepexec @p1 output,N'@P1 char(5),@P2 char(6)',N'select sometable.someID from sometable where sometable.someOtherID=(@P1) AND sometable.someField like (@P2)','1206 ','%jon% '
select @p1
Note the space at the end of all parameters. In a lot of cases this does not matter. We also notice it when we bulk-insert with prepared statements. (all the values have spaces appended, which is annoying).

Is there a configuration or something which we did not see, or is this a bug?

Regards
Raphael