I have several sprocsstored procedures that take a date/time input, one of which takes a date only in the form of an nvarchara nvarchar
because it utilizes dynamic SQL. WhenWhen I try to cast the variable going into the sproc I'm met withstored procedure, I get an error. ThisThis doesn't make much sense to me.
I know I can work around it by creating a second set of nvarcharnvarchar
variables or casting within the sprocstored procedure, but I'd like some insight on why I can't just cast the variable in-line.
Example. TOP is a Select statement telling me my NVARCHAR DATE kicks out just fine. MID is where SSMS is throwing the error, BOTTOM is where SSMS thinks it's just fine. *TOP is a Select statement telling me my NVARCHAR DATE kicks out just fine.
MID is where SSMS is throwing the error, BOTTOM is where SSMS thinks it's just fine.*