Skip to main content
TF 176 is documented now
Source Link
Paul White
  • 90.3k
  • 30
  • 423
  • 663

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value.

The warnings may be safely ignored in this case. This also applies to your execution plan, as far as I can tell - the implicit conversions involved in the CONCAT are not adversely affecting plan choice.

Using undocumenteddocumented and unsupportedsupported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value.

The warnings may be safely ignored in this case. This also applies to your execution plan, as far as I can tell - the implicit conversions involved in the CONCAT are not adversely affecting plan choice.

Using undocumented and unsupported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value.

The warnings may be safely ignored in this case. This also applies to your execution plan, as far as I can tell - the implicit conversions involved in the CONCAT are not adversely affecting plan choice.

Using documented and supported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

Updated to address comment
Source Link
Paul White
  • 90.3k
  • 30
  • 423
  • 663

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value. 

The warnings may be safely ignored in this case. This also applies to your execution plan, as far as I can tell - the implicit conversions involved in the CONCAT are not adversely affecting plan choice.

Using undocumented and unsupported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value. The warnings may be safely ignored in this case.

Using undocumented and unsupported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value. 

The warnings may be safely ignored in this case. This also applies to your execution plan, as far as I can tell - the implicit conversions involved in the CONCAT are not adversely affecting plan choice.

Using undocumented and unsupported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

added 432 characters in body
Source Link
Paul White
  • 90.3k
  • 30
  • 423
  • 663

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value. The warnings may be safely ignored in this case.

Using undocumented and unsupported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value. The warnings may be safely ignored in this case.

The implicit conversions are caused by the computed column AltKey:

CREATE TABLE dbo.Test
(
    [sessionid] [decimal](18, 0) NOT NULL,
    [sessionseqnum] [smallint] NOT NULL,
    [nodeid] [smallint] NOT NULL,
    [profileid] [int] NOT NULL,
    [AltKey] AS 
        CONCAT
        (
            [sessionid],
            [sessionseqnum],
            [nodeid],
            [profileid]
        ) PERSISTED NOT NULL,
);

Given the above simplified table, the simple statement below generates the same implicit conversion warnings given in the question:

SELECT T.*
FROM dbo.Test AS T;

Plan with warnings

From the documentation (emphasis added):

CONCAT implicitly converts all arguments to string types before concatenation.

The warning is added when SQL Server considers a plan alternative that does not use the persisted value, but computes the value explicitly. The warning is not removed if the final plan uses the persisted value. The warnings may be safely ignored in this case.

Using undocumented and unsupported trace flag 176 prevents persisted computed column expansion and removes the warnings:

SELECT * 
FROM dbo.Test AS T
OPTION (QUERYTRACEON 176);

with tf 176

See my article Properly Persisted Computed Columns for more details.

Source Link
Paul White
  • 90.3k
  • 30
  • 423
  • 663
Loading