sql += " SELECT ";
sql += " T1.name AS ColumnName, ";
sql += " T1.max_length AS ColumnLength, ";
sql += " T3.name AS TypeName ";
sql += " FROM ";
sql += " ( ";
sql += " SELECT object_id FROM sys.tables WHERE name = '{0}' ";
sql += " ) T2 ";
sql += " LEFT OUTER JOIN sys.columns T1 ";
sql += " ON T1.object_id = T2.object_id ";
sql += " LEFT OUTER JOIN sys.types T3 ";
sql += " ON T1.system_type_id = T3.system_type_id ";
sql += " AND T1.user_type_id = T3.user_type_id ";
sql += " order by T1.column_id ";