Test-VarcharLength #7976
Replies: 3 comments 1 reply
-
Sup @pollusb! I have needed similar things in the past, especially with CSV files and text. This command would be a great addition, but would likely be |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. The function is running a TSQL MAX on each text column in one pass using a TOP. But I am thinking about using also AVG to calculate the real opportunity ratio for improvment. And since I would be there, I could also throw in MIN and STDVAR using a OK, I like the datalenght idea. It would also help with VARCHAR(MAX) And if I get to choose the name, it would be |
Beta Was this translation helpful? Give feedback.
-
lol that works |
Beta Was this translation helpful? Give feedback.
-
I created a function to calculate the max length of all text fields in a table to evaluate the opportunity to reduce the datatype max to a lower number. This would reduce the excessive memory grant in query plans. This function accept a Sample Rate or Sample Top for testing purposes. Because of course, you want to know the real number before reducing fields size.
Should I take time to send a PR ?
Beta Was this translation helpful? Give feedback.
All reactions