Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Hugo Kornelis Newsgroups: comp.databases.ms-sqlserver Subject: Re: Dynamic SQL madness on SQL 2008 Date: Fri, 30 Sep 2011 21:33:41 +0200 Lines: 10 Message-ID: References: <67a6ef76-3dbb-4225-9372-b93efcfa36ed@m5g2000vbe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net dNRR0oAwFuzKr6c0ZTjipg9MUEYz83uKUl3IqykGLxpnB+51Ah Cancel-Lock: sha1:SHKGxhO0dGlcvAN1Ry+PkYabdSc= X-Newsreader: Forte Agent 6.00/32.1186 Xref: x330-a1.tempe.blueboxinc.net comp.databases.ms-sqlserver:693 Hi JAW, The error message tells you what the problem is. The parameter for sp_executesql that holds the statement should be of type ntext/nchar/nvarchar. You have declared it as varchar. Change that to nvarchar (and ditto for the parameter that holds the parameter list) and it will work. -- Hugo Kornelis, SQL Server MVP My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis