Comparing a fields actual size with defined size

K

kw72

I need to compare the actual size of a field with the defined size of the
field for all tables in a DB. I'm not sure how to go about it
programatically. Any help would be appreciated
 
J

John Spencer

Do you mean you want the maximum length of the value that is stored in
field?

SELECT Max(Len(someField)) as MaxSomeField,
Max(Len(someOther)) as MaxSomeOther
FROM SomeTable


You could write a VBA function to do this. and use a loop to step through
all the tables and all the fields.


Try this as a starting point

http://allenbrowne.com/func-06.html
 
Top