title: How to connect ms sql database using perl in Windows?
body: <p>I want to connect ms sql database through perl language. The following steps are I made.</p>
  
  <ul>
  <li>I've created a database table in the name "SampleDb"</li>
  <li>Configured ODBC and I've set name for sql server driver as "SampleDb"</li>
  <li>Now I've tried to connect as follows,</li>
  </ul>
  
  <p>,</p>
  
  <pre><code>my $dbs = "dbi:ODBC:DRIVER={SQL Server};SERVER={SampleDb}";
  my $dbh = DBI-&gt;connect($dbs, "username", "password");
  </code></pre>
  
  <p>But Now I got the following error</p>
  
  <pre><code>DBI connect('DRIVER={SQL Server};SERVER={SampleDB}','username',...) failed: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (SQL-08001) [state was 08001 now 01000]
  [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). (SQL-01000)
  </code></pre>
  
  <p><strong>How to solve this ? or
  How to Connect ms sql using perl through ODBC ?</strong></p>