Quantcast
Channel: SQL Errors – SQLSERVERLEARNER
Viewing all articles
Browse latest Browse all 74

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

$
0
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


Viewing all articles
Browse latest Browse all 74

Trending Articles