Wrong column type in sys.sql_modules #2604
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently,
definition
column in the view sys.sql_modules stores upto 4000 characters. SSMS scripting uses sys.sql_modules view to show the definition of the procedure, and the procedure definition is truncated to 4000 characters if the actual procedure definition is more than 4K.To avoid this incorrect definition, We can directly use
sys.nvarchar
and there is no need to specify the tymod of 4000 in case of sys.nvarchar for the definition column i.e.,sys.nvarchar(4000)
.Fixed the definition column for the views which should use nvarchar(max): sql_modules, system_sql_modules, all_sql_modules.
Issues Resolved
Task: BABEL-4870
Signed-off-by: Shalini Lohia [email protected]
Test Scenarios Covered
Use case based - Added test in DDL test framework. Also, testing using SSMS.
Boundary conditions -
Arbitrary inputs -
Negative test cases -
Minor version upgrade tests -
Major version upgrade tests -
Performance tests -
Tooling impact -
Client tests -