First of all, forget for this simple question but I have no idea why the data type size of the SQL Statement being passed from the Microsoft JDBC Driver to SQL Server is different than what it should be. I have the following java codes:
PreparedStatement updateTemplate = con.prepareStatement
("UPDATE db2inst1.TEMPLATE SET Template_Name = ? WHERE Template_sk = ? "
updateTemplate.setString(1, "TEST3 "
updateTemplate.setString(2, "a"
updateTemplate.executeUpdate();
AND THE SQL Statement i am seeingin SQL Server tracer is:
declare @P1 int
set @P1=1
exec sp_prepexec @P1 output, N'@P1 char(8000),@P2 char(8000)', N'UPDATE db2inst1.TEMPLATE SET Template_Name = @P1 WHERE Template_sk = @P2 ', 'TEST3','a'
Why are parameters set to char(8000)?
Thanks for your time.
PreparedStatement updateTemplate = con.prepareStatement
("UPDATE db2inst1.TEMPLATE SET Template_Name = ? WHERE Template_sk = ? "
updateTemplate.setString(1, "TEST3 "
updateTemplate.setString(2, "a"
updateTemplate.executeUpdate();
AND THE SQL Statement i am seeingin SQL Server tracer is:
declare @P1 int
set @P1=1
exec sp_prepexec @P1 output, N'@P1 char(8000),@P2 char(8000)', N'UPDATE db2inst1.TEMPLATE SET Template_Name = @P1 WHERE Template_sk = @P2 ', 'TEST3','a'
Why are parameters set to char(8000)?
Thanks for your time.