I'm assuming you possibly mean the max size of a field and not the size of
the data in the field (like finding out a column can contain a CHAR(255)).
I'm not sure about FreeTDS or SQL Server 7 but under DBD::Sybase
(they're closely relatated), you can find out this information by checking
the PRECISION attribute of the statement handle - not quite as convenient
as asp but ...
#!/usr/bin/perl -w
use DBI;
use Data::Dumper;
my $dbh = DBI->connect( 'dbi:Sybase:server=name', 'user', 'pass' );
$dbh->do( "use database" );
my $sql = "select * from alertquerystring order by alert_id";
my $sth = $dbh->prepare( $sql );
$sth->execute;
print "The fields returned are of type: ", Dumper( $sth->{TYPE} );
print "The fields have the following precision ", Dumper( $sth->{PRECI
+SION} );
$sth->finish;
$dbh->disconnect;
-derby |