TSQL comments not shown before CREATE VIEW statement
Posted: Thu 16 Feb 2017 21:02
When double clicking a view (default action edit view), any comments that are before the CREATE VIEW keywords are not displayed in either the 'Query Text' or 'T-SQL' tabs. Perhaps I am missing an option to enable this? The manual makes no mention of comments not being preserved.
In SSMS, when generating the script for the view object:
1) Highlight object in question.
2) Right-click to show context menu.
3) Select 'Script View as...' / 'CREATE to' / 'New Query Editor Window'
The generated script shows the comments preceding the CREATE VIEW AS keywords.
While this isn't a huge issue, it does prevent the maintenance of views using your product that have comments in the style mentioned. T-SQL comments after the CREATE VIEW AS are preserved in both SSMS and your product. I am using version 5.4.215 Professional in Windows 10 Pro.
In SSMS, when generating the script for the view object:
1) Highlight object in question.
2) Right-click to show context menu.
3) Select 'Script View as...' / 'CREATE to' / 'New Query Editor Window'
The generated script shows the comments preceding the CREATE VIEW AS keywords.
While this isn't a huge issue, it does prevent the maintenance of views using your product that have comments in the style mentioned. T-SQL comments after the CREATE VIEW AS are preserved in both SSMS and your product. I am using version 5.4.215 Professional in Windows 10 Pro.