Skip to content

Commit 84f68e5

Browse files
authored
Update README.md
1 parent cc60afc commit 84f68e5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ Connect to SQL Server and execute a simple query:
4747
import mssql_python
4848

4949
# Establish a connection
50-
# Specify connection string
51-
connection = "SERVER=<your_server_name>;DATABASE=<your_database_name>;UID=<your_user_name>;PWD=<your_password>;Encrypt=yes;")
50+
connection = mssql_python.connect(
51+
server='your_server',
52+
database='your_database',
53+
username='your_username',
54+
password='your_password'
55+
)
5256

5357
# Execute a query
5458
cursor = connection.cursor()
55-
cursor.execute("SELECT @@version")
59+
cursor.execute("SELECT * FROM your_table")
5660
rows = cursor.fetchall()
5761

5862
for row in rows:

0 commit comments

Comments
 (0)