title: Perl DBI SQL SERVER CONNECTIVITY ISSUES
body: <p>Very new to Perl. I am having issues trying to get DBI to communicate to a SQL server 2008 DB.</p>
  
  <p>I get the following error when I try and connect to SQL Servereveb when I try to use ODBC or directly.</p>
  
  <p>I am new to Perl,  can someone please assist...thanks</p>
  
  <p>install_driver(MSSQL) failed: Can't locate object method "set_sql" via package "Class::DBI::MSSQL" at C:/Perl/lib/DBD/MSSQL.pm line 79. Compilation failed in require at (eval 19)C:/Perl/site/lib/DBI.pm:744 line 3.</p>
  
  <pre><code>use strict; 
  use warnings;
  use diagnostics;
  use Class::DBI::Loader;   
  
  use DBI;
  
  use File::Glob ':glob';
  
  
  my $DBUserName                     = "*******";
  my $DBPassword                     = "*******";
  my $DBName                         = "dbi:MSSQL:uat-dbserver1";
  
  my $dbh                         = "";
  my $sqlStatement                 = "";
  my $sqlCmd                         = "";
  
  my @EasySetTableNames            = ();
  
  
  
  $dbh = DBI-&gt;connect( $DBName, $DBUserName, $DBPassword,
      { PrintError =&gt; 0, AutoCommit =&gt; 0})
          || die "Database connection creation failed: $DBI::errstr\n";
  
  $sqlStatement = "SELECT * from tableA ";
  $sqlCmd = $dbh-&gt;prepare($sqlStatement);
  $sqlCmd-&gt;execute();
  @EasySetTableNames = @{$dbh-&gt;selectcol_arrayref($sqlStatement)};
  print "hi";
  </code></pre>
  
  <p>and via ODBC </p>
  
  <pre><code>#!/usr/bin/perl -w
  use strict;
  
  use DBI;
  
  # Replace datasource_name with the name of your data source.
  # Replace database_username and database_password
  # with the SQL Server database username and password.
  my $data_source = "dbi:MSSQL:test";
  my $user = "test";
  my $password = "test";
  
  # Connect to the data source and get a handle for that connection.
  my $dbh = DBI-&gt;connect($data_source, $user, $password)
      or die "Can't connect to $data_source: $DBI::errstr";
  
  # This query generates a result set with one record in it.
  my $sql = "SELECT 1 AS test_col";
  
  # Prepare the statement.
  my $sth = $dbh-&gt;prepare($sql)
      or die "Can't prepare statement: $DBI::errstr";
  
  # Execute the statement.
  $sth-&gt;execute();
  
  # Print the column name.
  print "$sth-&gt;{NAME}-&gt;[0]\n";
  
  # Fetch and display the result set value.
  while ( my @row = $sth-&gt;fetchrow_array ) {
     print "@row\n";
  }
  
  # Disconnect the database from the database handle.
  $dbh-&gt;disconnect;
  </code></pre>
  
  <p>Any help you can provide would be so appreciated.</p>