Procedure expects parameter ‘@statement’ of type ‘ntext/nchar/nvarchar’

 

ERROR MESAGGE:

“Procedure expects parameter ‘@statement’ of type ‘ntext/nchar/nvarchar’.”

EXPLANATION:

You may see this error message when you run the command in a variable with the sp_executesql system SP.

Example:

Or if you run a command directly without using any variables, you will see the same error message:

SOLUTION:

In fact, the error is clearly written in the error message. The @statement parameter that you will use for the sp_executesql system SP should be UNICODE.

The correct versions of the above examples are as follows:

and

Ekrem Önsoy
Author: Ekrem Önsoy

The original article was written in Turkish by Ekrem Önsoy and translated to English by dbtut with the consent of the author. The copyright of the article belongs to the author. The author shall not be liable in any way for any defect caused by translation.

Leave a Reply

Your email address will not be published. Required fields are marked *