SQL Server execution plan with convert implicit

Copyright: copy, please indicate the source https://blog.csdn.net/weixin_39392627/article/details/87917399

 

env: Windows Server 2016

         SQL Server 2016 SP2

 

Recent reports see syntax help, find the following warning message often appears implementation plan:

Type conversion in expression ([i].[Item]=CONVERT_IMPLICIT(nvarchar(64),[XXXXX].[XXXXX],0)) may affect "SeekPlan" in query plan choice, Type conversion in expression ([i].[Item]=CONVERT_IMPLICIT(nvarchar(32),[XXXXX].[XXXXX],0)) may affect "SeekPlan" in query plan choice

 

The reason for this is caused by inconsistent data type equal on both sides of the relationship.

TABLE entities are consistent than the field data type of grammar used,

 

The reason to this case occurred, declares the cause of variable table:

DECLARE @TESTTB02 TABLE(Item NVARCHAR(64));
       
DECLARE @TESTTB02 TABLE(Item NVARCHAR(32));

NVARCHAR solution is to change VARCHAR, warning implicit conversion disappeared.

DECLARE @TESTTB02 TABLE(Item VARCHAR(64));
       
DECLARE @TESTTB02 TABLE(Item VARCHAR(32));

 

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_39392627/article/details/87917399