Comparing a fields actual size with defined size

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top