I have a procedure like this (simplified):
CREATE PROCEDURE test @userName VARCHAR(64)
SELECT *
FROM member M
INNER JOIN order O
ON M.MemberId=O.MemberId
WHERE M.Username = @userName
There is a non-clustered index on Username column of the Member table.
Plan cache shows an Implicit Conversion as such:
Seek Keys[1]: Prefix: [MyDatabase].[dbo].[Member].Username = Scalar Operator(CONVERT_IMPLICIT(varchar(64),[@Username],0))
I was just wondering what might be causing this implicit conversion as both the parameter and the field data type "UserName" is varchar(64)?
SP is called from framework like this:
EXEC test @Username=N'webSite.com'
Thank you.
order
is a keyword, and thus a terrible choice for a table name (and many would argue that a table of orders or members should not have singular names - this makes it seem like they will only ever contain exactly one row).