Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_executesql nText Sql2000

Status
Not open for further replies.

jagdeep

IS-IT--Management
Jul 29, 2002
12
IN
SQL Server does not allow to declare a varible of type nText
The maximum possible length for nvarchar is 4000, but my sql string is longer than that

is there a way of passing nText to sp_executesql in SQL 2000?
 
try with varchar. It allows 8000. Never tested this though.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
I think you will have to go with

execute(@MySQLString)

If you want to go longer than 4000. sp_executesql requires nvarchar..

Hope this helps,

Alex

[small]----signature below----[/small]
With all due respect, Don Bot, I don't think we should rely on an accident happening. Let's kill him ourselves.

Ignorance of certain subjects is a great part of wisdom
 
Or if this is not enough then you can concatenate by separating the information into multiple variables. Personally I believe that if your query is this complicated it is better to not build it dynamically if it can be avoided at all. Dynamic SQl is a bad thing for security anyway. And the more complex, the harder to debug as well.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top