0

So I have a temporary table with only one column NVARCHAR(400).

In this temp table, I Insert values from various sources.

One of these is

INSERT INTO @permissions
SELECT Concat (N'resourcetype_', CONVERT(NVARCHAR(36), resourcetypeid))
FROM   roleresourcetypepermission
WHERE  roleid = @roleId OR @IsAdmin = 1

I tried with + instead of CONCAT, tried not to convert them explicitly, nothing seems to be working. PlanWarnings

1 Answers1

2

Because they're two different data types, some type of conversion will always need to occur. You would need to persist the data already converted first to eliminate that warning.

That being said, this is in the SELECT part of your query and probably isn't actually causing any issues, therefore the warning can be disregarded. (If it was a type conversion in a predicate, that would be a different story.)

As mentioned by the community in the comments, it's unclear if you have any other issues other than the warning itself. If you're experiencing some sort of performance issues, then please update your question with more information and clarification, such as including the execution plan of the slow query itself.

J.D.
  • 40,776
  • 12
  • 62
  • 141