Max Field Length From a Data File
Sometimes you have a .csv or a pipe delimited file that you need to insert into a database. You need to create the table using SQL and you’re not sure whether to use VARCHAR(40) or VARCHAR(100).
If only you could quickly tell what the longest field for each column was…
Here’s a script to do that:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Then, just run it from the command line:
1
|
|
Hope this helps.