Does `sp_executesql` really accepts the `nvarchar(max)` argument?
问题 Summary: The EXEC sp_executesql @code fails for the content longer than 4000 in the @code , but the @code is not truncated to 4000 unicode characters. I am observing the problem on SQL Server 2014 Developer Edition. More details: my SQL installation script defines some code dynamically because it should modify the code so that it reflects the environment (only once, during the installation). Let the following @datasource variable captures results for the specific environment: DECLARE