Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > DECLARE @x nvarchar(max) = N'x', @sql nvarchar(max); > SELECT @x = REPLICATE(@x, 985); > > SET @sql = N'CREATE PROCEDURE dbo.foo > AS > SELECT x = N''qbert$x$x$x$x$xqbert'';'; > > SET @sql = REPLACE(@sql, N'$x', @x); > > EXEC sys.sp_executesql @sql; > GO > > <pre> > ✓ > </pre> <!-- --> > SELECT > name = object_name(id), > len_this_row = len(text), > len_whole_procedure = len(object_definition(id)), > text > FROM sys.syscomments > WHERE text LIKE N'%qbert%'; > GO > > <pre> > name | len_this_row | len_whole_procedure | text > :--- | -----------: | ------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > foo | 4000 | 4980 | CREATE PRO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