I faced problem when I called sp_executesql
and I passed varchar parameter.
I got this error:
See Question&Answers more detail:osProcedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.
I faced problem when I called sp_executesql
and I passed varchar parameter.
I got this error:
See Question&Answers more detail:osProcedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.
Psychic debugger says you either are passing to SP_ExecuteSQL
a variable of type varchar (make it nvarchar), or you've got a string you haven't used the unicode prefix on:
E.g.
Exec sp_executesql 'select * from something'
To fix it use:
Exec sp_executesql N'select * from something'
Notice the N
prefix on the string.