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
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