Msg 214, Level 16, State 2, Procedure sp_executesql, Line 1

Posted on : 11-05-2012 | By : Devi Prasad | In : sp_executesql, SQL Errors, System Stored Procedures

Share:

0


When you try to execute sp_executesql you get the below error:


Msg 214, Level 16, State 2, Procedure sp_executesql, Line 1
Procedure expects parameter ‘@statement’ of type ‘ntext/nchar/nvarchar’.

Fix:
Add N Before the sql query.

Before:

EXEC sp_executesql 'SELECT 1'

After:

EXEC sp_executesql N'SELECT 1'

Applies to SQL Server 2000,SQL Server 2005,SQL Server 2008,SQL Server 2008 r2,SQL Server 2012, SSIS

(Visited 456 times, 1 visits today)



References : Devi Prasad (sqlserverlearner.com)

Need Help On SQL Server?

Cannot Find Solution to your problem (or) If you are looking for some help on SQL Server. Dont worry Click Here to Post your question and solve your issue.


Do you like my blog?

If you liked reading this blog, please help spread the word by sharing this blog with your friends.




Write a comment



Tags: ,