Skip to content

Commit ecdff86

Browse files
authored
Update README.md
1 parent 34e1fbf commit ecdff86

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

README.md

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

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

5753
# Execute a query
5854
cursor = connection.cursor()
59-
cursor.execute("SELECT * FROM your_table")
55+
cursor.execute("SELECT @@version")
6056
rows = cursor.fetchall()
6157

6258
for row in rows:

0 commit comments

Comments
 (0)