title: how to connect sql server with linux?
body: <p>Whenever i will run Perl code i got following error:</p>
  
  <pre><code>DBI connect('SQLSERVER','rti_dbuser',...) failed: [unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002) at /usr/WINAST/RTI/AGI/M_TEST.pl line 14
  Coudn't Connect SQL at /usr/WINAST/RTI/AGI/M_TEST.pl line 14.
  </code></pre>
  
  <p>The configuration file are given below:</p>
  
  <p>odbc.ini</p>
  
  <pre><code>[SQLSERVER]
  description = Asterisk ODBC for SQL SERVER
  ;driver = FreeTDS 
  Driver = /usr/local/lib/libtdsodbc.so
  server = 10.2.20.42\APSHCL
  Database = RTI
  port = 1433
  tds_version = 9.0
  try domain login = yes
  try server login = yes
  nt domain = DOMAIN
  language = us_english
  </code></pre>
  
  <p>odbcinst.ini</p>
  
  <pre><code>[FreeTDS]
  Description = FreeTDS ODBC driver for MSSQL
  Driver = /usr/local/lib/libtdsodbc.so
  Setup = /usr/local/lib/libtdsS.so
  FileUsage = 1
  </code></pre>
  
  <p>My code</p>
  
  <pre><code>use DBI;
  use Data::Dumper;
  use Asterisk::AGI;
  my $agi = new Asterisk::AGI;
  $first_param  = $ARGV[0];
  
  my $DSN = q/dbi:ODBC:SQLSERVER/;
  my $uid = q/username/;
  my $pwd = q/password/;
  
  my $DRIVER = "Freetds";
  my $dbh = DBI-&gt;connect($DSN,$uid,$pwd) or die "Coudn't Connect SQL";
  my $servernumber = 2;
  
  
  my $sql = "EXEC usp_check_black_list '".$first_param."'" ;
  
  my $sth = $dbh-&gt;prepare($sql);
  $sth-&gt;execute();
  
  $return = $sth-&gt;fetchrow();
  $agi-&gt;set_variable('result',$return);
  print Dumper($return);
  $sth-&gt;finish;
  $dbh-&gt;disconnect;
  </code></pre>
  
  <p>whenever i'm executing my perl code, the driver is not found.I have already define the driver but it is not use that driver....</p>
  
  <p>please help me...</p>