October 24, 2012 at 3:16 am
I'm slightly stumped as to why I am seeing an implicit conversion seeing as though it's converting a varchar(255) to varchar(255).
<ScalarOperator ScalarString="CONVERT_IMPLICIT(varchar(255),[MyDb].[dbo].[AGREEMENT].[REFERENCE] as [tl].[REFERENCE],0)">
Here is the table in question
CREATE TABLE [dbo].[AGREEMENT](
[ID] [numeric](19, 0) NOT NULL,
[REFERENCE] [varchar](255) NULL,
[VERSION] [numeric](19, 0) NULL,
CONSTRAINT [PK_AGREEMENT] PRIMARY KEY CLUSTERED ([ID] ASC));
GO
The server collation, tempdb collation and my user database collation are all the same, SQL_Latin1_General_CP1_CI_AS.
October 24, 2012 at 4:08 am
Can you provide some more information? Such as the minimum query that'll generate the implicit conversion?
Thomas Rushton
blog: https://thelonedba.wordpress.com
October 24, 2012 at 4:26 am
Not sure. I'd need to see the query and XML execution plan.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 24, 2012 at 8:09 am
While attempting to reproduce this in another database I discovered the issue. My user table was created with ANSI PADDING off while the temp table I'm loading was created with it on.
The following insert will cause an implicit conversion from varchar(255) to varchar(255):
SET ANSI_PADDING OFF;
CREATE TABLE TestChar (MyColumn VARCHAR(255));
SET ANSI_PADDING ON;
CREATE TABLE #Target (MyColumn VARCHAR(255));
INSERT INTO #Target
SELECT * FROM TestChar;
October 24, 2012 at 8:36 am
Artoo22 (10/24/2012)
While attempting to reproduce this in another database I discovered the issue. My user table was created with ANSI PADDING off while the temp table I'm loading was created with it on.The following insert will cause an implicit conversion from varchar(255) to varchar(255):
SET ANSI_PADDING OFF;
CREATE TABLE TestChar (MyColumn VARCHAR(255));
SET ANSI_PADDING ON;
CREATE TABLE #Target (MyColumn VARCHAR(255));
INSERT INTO #Target
SELECT * FROM TestChar;
That's excellent! Well done on troubleshooting it.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 24, 2012 at 8:48 am
Isn't the Implicit Conversion in the Computer Scalar operator simply what deals with removing (or adding depending on settings) the trailing spaces (the padding)?
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply