I'm writing T4 templates to generate CRUD stored procs etc
I am looping through the columns of a table using SMO:
For Each column As Column In table.Columns
WriteLine("@" & column.Name & " " & column.DataType.Name & ", ")
Next
My question is simply how do I find the Length of a varchar column? There doesn't appear to be any Length / MaxLength etc property on the column.
I'm using http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.column_members.aspx as a reference