Well, I don't have experience with this, but turning your output into what SQL Server says isn't too hard:
sub bin2hextext { my ($blob) = shift; "0x" . join ('', map {sprintf("%02X",unpack("C",$_))} split(//, $blob)); } my $DSN = 'driver={SQL Server};Server=new-borg;database=master;uid=;pw +d=;'; my $dbh = DBI->connect("dbi:ODBC:$DSN") or die "$DBI::errstr\n"; my $sql = qq{ select * from sysusers }; my $sth = $dbh->prepare ($sql); $sth->execute(); my @varbincolumns = qw(2); while (@row = $sth->fetchrow_array()) { @row[@varbincolumns] = map {bin2hextext($_)} @row[@varbincolumns]; print $#row,':',join(':',@row),"\n"; } $sth->finish();
A more polished version would figure out the contents of the @varbincolumns array using $sth->{TYPE}.
In reply to Re: SQLServer varbinary headache
by fizbin
in thread SQLServer varbinary headache
by bfdi533
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |