#!C:/Perl/bin/perl.exe
use DBD::ODBC ;
my $dsn = join "", (
"dbi:ODBC:",
"Driver={SQL Server};",
"Server=hostName\\POC_QA;",
"UID=ysg;",
"PWD=pass;",
"Database=CAS_DEV",
);
my $user = 'userName';
my $passwd = 'Password';
my $db_options = {
PrintError => 1,
RaiseError => 1,
AutoCommit => 0, #Use transactions
};
my $dbh =
DBI->connect($dsn, $user, $passwd, $db_options) or exit_msg("Can't connect: $DBI::errstr");
open ( FH , ">DbName.txt" ) or die " cannot open DbName.txt " ;
$sth = $dbh->prepare("
--select TABLE_NAME from INFORMATION_SCHEMA.TABLES ;
SELECT TABLE_CATALOG , TABLE_NAME , COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS ; ")
;
$sth->execute;
$sth->execute;
while (@row=$sth->fetchrow_array)
{
print "\t",join "\t",@row,"\n";
print FH "",join "\t",@row,"\n";
}
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!