-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlread.py
More file actions
32 lines (19 loc) · 734 Bytes
/
Copy pathsqlread.py
File metadata and controls
32 lines (19 loc) · 734 Bytes
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
#!/usr/bin/env python
# coding: utf-8
# <h1>Table of Contents<span class="tocSkip"></span></h1>
# <div class="toc"><ul class="toc-item"></ul></div>
# In[ ]:
import pandas as pd
import pyodbc
conn = pyodbc.connect('Driver={SQL Server Native Client 11.0};'
'Server=internalSQLdev.mridevops.com;'
'Database=Codebook_Taxonomy;'
'Trusted_Connection=yes;')
Prev_Dict_StudyEntryID = '411'
Prev_Dict_VersionID = '13'
query = "EXEC [app_Codebook_Read] @VersionID = {0}, @StudyEntryID = {1}".format(Prev_Dict_VersionID, Prev_Dict_StudyEntryID)
df = pd.read_sql_query(query, conn)
print(df)
print(type(df))
# In[ ]:
#om Codebook_Taxonomy.dbo.tmp_editedrecords_test