jeudi 29 janvier 2015

Can't cast a SPROC parameter?


I have several sprocs that take a date/time input, one of which takes a date only in the form of an nvarchar because it utilizes dynamic SQL. When I try to cast the variable going into the sproc I'm met with an error. This doesn't make much sense to me.


I know I can work around it by creating a second set of nvarchar variables or casting within the sproc, 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.


sproc wtfman





Aucun commentaire:

Enregistrer un commentaire