Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

try as below to print entire string,

SET @Query = 'SELECT ....' [Up To 4,000 characters, then rest of statement as below] SET @Query = @Query + [rest of statement] Now run your query as normal i.e. EXEC ( @Query ) 

got the answer from below link

nvarchar(max) still being truncatednvarchar(max) still being truncated

try as below to print entire string,

SET @Query = 'SELECT ....' [Up To 4,000 characters, then rest of statement as below] SET @Query = @Query + [rest of statement] Now run your query as normal i.e. EXEC ( @Query ) 

got the answer from below link

nvarchar(max) still being truncated

try as below to print entire string,

SET @Query = 'SELECT ....' [Up To 4,000 characters, then rest of statement as below] SET @Query = @Query + [rest of statement] Now run your query as normal i.e. EXEC ( @Query ) 

got the answer from below link

nvarchar(max) still being truncated

Source Link
bmsqldev
  • 2.8k
  • 10
  • 39
  • 72

try as below to print entire string,

SET @Query = 'SELECT ....' [Up To 4,000 characters, then rest of statement as below] SET @Query = @Query + [rest of statement] Now run your query as normal i.e. EXEC ( @Query ) 

got the answer from below link

nvarchar(max) still being truncated