We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5c5737a + 19f4281 commit e9be253Copy full SHA for e9be253
1 file changed
docs/pymssql_examples.rst
@@ -44,6 +44,24 @@ Basic features (strict DB-API compliance)
44
45
conn.close()
46
47
+Connecting using Windows Authentication
48
+=======================================
49
+
50
+When connecting using Windows Authentication, this is how to combine the
51
+database's hostname and instance name, and the Active Directory/Windows Domain
52
+name and the username. This example uses
53
+`raw strings <https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals>`_
54
+(``r'...'``) for the strings that contain a backslash.
55
56
+::
57
58
+ conn = pymssql.connect(
59
+ host=r'dbhostname\myinstance',
60
+ user=r'companydomain\username',
61
+ password=PASSWORD,
62
+ database='DatabaseOfInterest'
63
+ )
64
65
Iterating through results
66
=========================
67
0 commit comments