-
Couldn't load subscription status.
- Fork 316
Closed
Labels
Area\DocumentationUse this for issues that requires changes in public documentations/samples.Use this for issues that requires changes in public documentations/samples.
Description
If EnableOptimizedParameterBinding is true and you are calling a stored procedure with optional parameters, then the call may behave unexpectedly.
For example, say you stored procedure is
CREATE PROCEDURE dbo.UploadToMaxTest
@AnsiLimted VarChar(500) = null,
@UniLimited NVarChar(1000) = null,
@Ansi VarChar(Max) = null,
@Uni NVarChar(Max) = null
AS
[...]
And you want to pass in two parameters.
EXEC dbo.UploadToMaxTest @Ansi = 'AAAA', @Uni = N'UUUU';
If you turn on EnableOptimizedParameterBinding, then the generated SQL is...
EXEC dbo.UploadToMaxTest 'AAAA', N'UUUU';
Which means the wrong parameters will be used.
It should be called out in the documentation that EnableOptimizedParameterBinding is not compatible with missing optional parameters because the parameter names will be missing from the SQL.
Metadata
Metadata
Assignees
Labels
Area\DocumentationUse this for issues that requires changes in public documentations/samples.Use this for issues that requires changes in public documentations/samples.
Type
Projects
Status
Closed