Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
i need to execute a long dynamic sql, but NVARCHAR only have limit upto 4000, what should i do.I need NVARCHAR upto 10000
tfountain
Constraint Violating Yak Guru
491 Posts
Posted - 2007-11-27 : 13:10:13
This question is pretty vague. If your limit is 4000 characters, and you need 1000 characters you should be ok. I'm assuming you are attempting to execute dynamic SQL via the EXEC or sp_executesql statements. But what you are asking is unclear.
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts
Posted - 2007-11-27 : 13:56:02
You can use an nvarchar(max) local variable to hold a really long dynamic SQL statement.