Schemaspy apparently does not show the full length of longish code files

102 Views Asked by At

We used schemaspy to read the stored procedure from the database. We found that schemaspy can not read the full definition of the procedure. Is there any possibility to fix this bug?Procedure definition

Reading the definition helps to understand and follow the procedure

1

There are 1 best solutions below

0
On

The solution was from the ticket https://github.com/schemaspy/schemaspy/issues/804

The file \BOOT-INF\classes\org\schemaspy\types\mssql08.properties was updated accordingly.

old:

selectRoutinesSql=SELECT i_s.routine_name, i_s.routine_type, i_s.data_type AS dtd_identifier, i_s.routine_body, i_s.routine_definition, i_s.is_deterministic, i_s.sql_data_access, \
NULL AS security_type, NULL AS sql_mode, CAST(s.value AS NVARCHAR(MAX)) AS routine_comment \
FROM information_schema.routines i_s LEFT JOIN sys.extended_properties s ON s.major_id = OBJECT_ID(i_s.routine_catalog + '.' + i_s.routine_schema + '.' + i_s.routine_name) AND s.class = 1 AND s.name = 'MS_Description' AND s.minor_id = 0 \
WHERE routine_schema = :schema

new:

selectRoutinesSql=SELECT i_s.routine_name, i_s.routine_type, i_s.data_type AS dtd_identifier, i_s.routine_body, (SELECT modules.definition FROM sys.sql_modules modules WHERE object_id=OBJECT_ID(routine_schema+'.'+i_s.routine_name)) AS routine_definition, i_s.is_deterministic, i_s.sql_data_access, \
NULL AS security_type, NULL AS sql_mode, CAST(s.value AS NVARCHAR(MAX)) AS routine_comment \
FROM information_schema.routines i_s LEFT JOIN sys.extended_properties s ON s.major_id = OBJECT_ID(i_s.routine_catalog + '.' + i_s.routine_schema + '.' + i_s.routine_name) AND s.class = 1 AND s.name = 'MS_Description' AND s.minor_id = 0 \
WHERE routine_schema = :schema

For any update of the SchemaSpy version this change must be considered and applied to the new jar file.