title: Connect perl to SQL Server management 2012
body: <p>I am new to perl. I am given a task to connect to SQL server management 2012 and print a table from the database. Can you please guide me how to install all the drivers required  and advise me what is wrong with my code, as i get no error and no required output.  </p>
  
  <pre><code>use DBI;  
  my $host     = 'programer';                               #servername  
  my $database = 'DW';                                      #database name  
  my $user     = 'prg';                                     #username  
  my $pwd     = 'prg@123';                                  #password  
  my $dsn = "dbi:ODBC:Driver={SQL Server};Server=$host;Database=$database";  
  my $dbh = DBI-&gt;connect($dsn, $user, $pwd) or die("database not found");
  $query="select * from Banking_AccountSummary_Citibank";  
  $exe=$dbh-&gt;prepare($query) or die("cannot prepapre query");  
  $exe-&gt;execute()or die("cannot execute");  
  $dbh-&gt;disconnect
  </code></pre>
  
  <p>Please guide me...</p>