I have temp table which contains nearly 200 columns. I need to know the max length of each column such that I can rectify the warning ''string or binary data would be truncated''. Now I can't mention all columns like
select max(len(col1)),max(len(col2))....,,, from #tableA
Now how can I get max length of all columns?
Try this :
Please find more information here How can I get column names from a table in SQL Server?