Skip to content

Commit 9504a15

Browse files
committed
add len req to show limit message on sp contents
1 parent 928506d commit 9504a15

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sp_doc.sql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,15 @@ BEGIN
602602
,(CONCAT(CHAR(13), CHAR(10), ''<details><summary>Click to expand</summary>''));' +
603603

604604
--Object definition
605-
+ N'IF (@LimitStoredProcLength = 1)
605+
+ N'
606+
IF (@LimitStoredProcLength = 1 AND LEN(OBJECT_DEFINITION(@objectid)) > 8000)
606607
BEGIN;
607608
INSERT INTO #markdown (value)
608609
VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'',
609610
CHAR(13), CHAR(10), CAST(OBJECT_DEFINITION(@objectid) AS VARCHAR(8000))))
610-
,(''/**************************************************************************************************/'')
611-
,(''/* sp_doc: Contents truncated at 8000 characters. Set @LimitStoredProcLength = 0 to remove limit. */'')
612-
,(''/**************************************************************************************************/'')
611+
,(''/************************************************************************************************/'')
612+
,(''/* sp_doc: Max 8000 characters reached. Set @LimitStoredProcLength = 0 to show full definition. */'')
613+
,(''/************************************************************************************************/'')
613614
,(''```'');
614615
END;
615616
ELSE

0 commit comments

Comments
 (0)