I'm working with SQL Server 2000 and i got this problem about dynamic sql query. i have successfully produced a query that i need, the problem is when storing it in the variable. In SQL Server 2000, nvarchar has a max value of 4000 bit? or length, not so sure.. but as i have read in Google, and as far as i know, SQL server 2005 has the nvarchar(max) which could hold on up to 2GB memory. I have to use nvarchar because i pass the variable to the sp_executesql stored procedure, and as i have read in this article, <a> http://www.mssqltips.com/sqlservertip/1160/execute-dynamic-sql-commands-in-sql-server/ </a> it seems that EXEC has a problem regarding long queries so it was a preferred approach to use sp_executesql. Is there any other way to pass a lenghty, large size of a query