This is probably a strange question... Hopefully, someone enjoys the more esoteric portion of SQL. :)
I have some views with many columns. The column widths are obstructive to reviewing the data. Once a column width is manually adjust and the view is saved, the column is perpetually saved at that width unless manually changed and again saved.
This makes me wonder how SQL saves column widths. Is there a table containing that data? If so, could an updated query revise all the columns for a given table to a defined width? If so, how?
Just FYI, my DBA and I spent a good while trying to figure this out. I am not asking without first endeavoring to solve it myself. I am a novice with SQL and hope for more experienced guidance.
Solution: use sp_refreshview (this demo shows that SQL Server doesn't automatically update metadata information for
dbo.MyView
after I change the maximum length fordbo.MyTable.Col2
and we have to usesp_refreshview
[orALTER VIEW
,DROP
&CREATE
] to update metadata for the view):