﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 07:23:27 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.</title><link>http://www.sqlservercentral.com/Forums/Topic505092-338-1.aspx</link><description>..with possibilities of truncation?</description><pubDate>Sun, 13 Nov 2011 02:54:01 GMT</pubDate><dc:creator>John Esraelo-498130</dc:creator></item><item><title>RE: sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.</title><link>http://www.sqlservercentral.com/Forums/Topic505092-338-1.aspx</link><description>You can also use nvarchar(max) which replaces ntext.Drew</description><pubDate>Thu, 10 Nov 2011 07:44:37 GMT</pubDate><dc:creator>drew.allen</dc:creator></item><item><title>RE: sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.</title><link>http://www.sqlservercentral.com/Forums/Topic505092-338-1.aspx</link><description>this explains it why mine did not work also.. I had bigint and table data types.. </description><pubDate>Wed, 09 Nov 2011 17:14:26 GMT</pubDate><dc:creator>John Esraelo-498130</dc:creator></item><item><title>RE: sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.</title><link>http://www.sqlservercentral.com/Forums/Topic505092-338-1.aspx</link><description>[quote][b]mayank.and.friends (6/10/2009)[/b][hr]Sql string should be always either ntext/nvarchar/nchar.[/quote]Only necessary when using sp_executesql (which takes nvarchar parameters). Not important when using EXEC. Also, you cannot define a variable of type ntext.</description><pubDate>Wed, 10 Jun 2009 08:06:11 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.</title><link>http://www.sqlservercentral.com/Forums/Topic505092-338-1.aspx</link><description>Sql string should be always either ntext/nvarchar/nchar.So ,please check type of sql query variable as nvarchar():w00t:</description><pubDate>Wed, 10 Jun 2009 05:03:15 GMT</pubDate><dc:creator>mayank.and.friends</dc:creator></item><item><title>RE: sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.</title><link>http://www.sqlservercentral.com/Forums/Topic505092-338-1.aspx</link><description>you can use exec, since you're not passing parameters in or out of the dynamic SQL[code]CREATE  procedure Search(@SearchKeyword Varchar(2000),@Productid varchar(2000),@Type varchar(200),@SQLPerms varchar(5000))asDeclare @SQL varchar(7000)set @SQL=' This Statement length goes more than 4000.'exec (@SQL)GO[/code]Make sure you're checking for SQL injection attempts.</description><pubDate>Thu, 22 May 2008 05:50:27 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>sp_executesql : Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.</title><link>http://www.sqlservercentral.com/Forums/Topic505092-338-1.aspx</link><description>Hi, I am using dynamic query in stored procedure. while i am trying to execute the SQL Query in the Procedure, i am getting the error 'Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.Because i have passed the parameter as Varchar in sp_executesql. The parms must be nVarchar. But my issues is, [b]the length of Dynamic SQL Query is more than 4000. nVarchar maximum lenght is 4000[/b]. Please let me know the solution.my Stored Procedure as,CREATE  procedure Search(@SearchKeyword Varchar(2000),@Productid varchar(2000),@Type varchar(200),@SQLPerms varchar(5000))asDeclare @SQL varchar(7000)[b]set @SQL=' This Statement length goes more than 4000.'[/b]exec sp_executesql @SQLGOAppriciate your response asap.Regards,Vijay</description><pubDate>Thu, 22 May 2008 05:42:23 GMT</pubDate><dc:creator>antonyvijayan</dc:creator></item></channel></rss>