File: azure.rst

package info (click to toggle)
pymssql 2.1.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 952 kB
  • sloc: python: 2,872; sh: 240; makefile: 148; ansic: 7
file content (32 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
================================
Connecting to Azure SQL Database
================================

Starting with version 2.1.1 pymssql can be used to connect to *Microsoft Azure
SQL Database*.

Make sure the following requirements are met:

* Use FreeTDS 0.91 or newer
* Use TDS protocol 7.1 or newer
* Make sure FreeTDS is built with SSL support
* Specify the database name you are connecting to in the *database* parameter of
  the relevant ``connect()`` call
* **IMPORTANT**: Do not use ``username@server.database.windows.net`` for the
  *user* parameter of the relevant ``connect()`` call! You must use the shorter
  ``username@server`` form instead!

Example::

    pymssql.connect("xxx.database.windows.net", "username@xxx", "password", "db_name")

or, if you've defined ``myalias`` in the ``freetds.conf`` FreeTDS config file::

    [myalias]
    host = xxx.database.windows.net
    tds version = 7.1
    ...

then you could use::

    pymssql.connect("myalias", "username@xxx", "password", "db_name")