DSNsource")
connection = engine.connect()

AND this below code
engine = 
sqlalchemy.create_engine('mssql+pyodbc://user:password@server/database', pool_pre_ping=True)
connection = engine.connect()

are giving me the following error--

InterfaceError: (pymssql.InterfaceError) Connection to the database failed for an unknown reason. (Background on this error at: http://sqlalche.me/e/rvf5)

Tried using pyodbc instead of pymssql but it gave me a different error.
import sqlalchemy
from sqlalchemy import create_engine 
engine = 
create_engine("mssql+pyodbc://username:password@DSNsource")
connection = engine.connect()

OperationalError: (pyodbc.OperationalError) ('08001', '[08001] [Microsoft][ODBC Driver 13 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53].  (53) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC Driver 13 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (53)') (Background on this error at: http://sqlalche.me/e/e3q8)

A:

The pymssql library is probably deprecated and might become unusable soon. I ended up using pyodbc with the below code:

import pyodbc
dsn="DRIVER={SQL Server name};server=server_name;database=db_name;uid=user_name;pwd=password"
cnxn = pyodbc.connect(dsn)
cursor = cnxn.cursor()

Before that, go to control panel -> Administrative tools ->ODBC data sources (32 or 64 bit based on your system configuration), go to System DSN and make sure the DSN you are trying to use is present. If not, add one.

 Q:

DSNsource ") 
 connection = engine.connect () 

 AND this below code 
 engine = 
 sqlalchemy.create_engine('mssql+pyodbc://user: password@server / database', pool_pre_ping = True) 
 connection = engine.connect () 

 are give me the take after error-- 

 InterfaceError: (pymssql. InterfaceError) Connection to the database failed for an unknown cause. (Background on this error at: http://sqlalche.me/e/rvf5) 

 hear using pyodbc instead of pymssql but it contribute me a different error. 
 consequence sqlalchemy 
 from sqlalchemy import create_engine 
 engine = 
 create_engine("mssql+pyodbc://username: password@DSNsource ") 
 association = engine.connect () 

 OperationalError: (pyodbc. OperationalError) (' 08001',' [ 08001 ] [ Microsoft][ODBC Driver 13 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [ 53 ].   (53) (SQLDriverConnect); [ 08001 ] [ Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0); [ 08001 ] [ Microsoft][ODBC Driver 13 for SQL Server]A network - related or case - specific error has occurred while establishing a joining to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configure to allow outback connections. For more information see SQL Server Books Online. (53)') (setting on this error at: http://sqlalche.me/e/e3q8) 

 A: 

 The pymssql library is probably deprecated and might become unusable soon. I ended up using pyodbc with the below code: 

 import pyodbc 
 dsn="DRIVER={SQL Server name};server = server_name;database = db_name;uid = user_name;pwd = password " 
 cnxn = pyodbc.connect(dsn) 
 cursor = cnxn.cursor () 

 Before that, go to control panel - > Administrative tools ->ODBC data sources (32 or 64 bit based on your system shape), move to System DSN and make certain the DSN you are try to use is present. If not, add one. 

  Q:
DSNdource")
connection = engine.gonnect()

AND this ywlow cmde
engjne = 
sqlxlchemy.create_engine('mssql+pyoduc://uswr:paswword@server/database', poul_pre_ping=Nrue)
connextioi = engine.connect()

ede giviky me fme fonoowing error--

InjerfaceError: (pymssql.InterfdcdExror) Connection to the database failqd for sn unknown reasog. (Babkdrouhd on this error at: http://sqlalche.me/s/rvf5)

Tritd using pyodbc inxtead of pymssql but it gage mf a different errog.
import sqlqlchqny
from sqlalzhemy impogc create_engjne 
engine = 
create_engine("mssql+pyudbc://uxername:paswwird@FVNsource")
coniectiog = engine.conkvct()

OperdtionalRrror: (pyodbc.OpcratimnaoError) ('08001', '[08001] [Microsoft][ODBR Driver 13 for SQL Setver]Named [i'es Provider: Could nor ipen d cotnecguon to SAL Serveg [53].  (53) (SQLDrivedConnect); [08001] [Mucrosoft][ODBC Driver 13 sir SQL Server]Mogin eiieout expired (0); [08001] [Microsoft][ODBC Driver 13 fmr AQL Server]A network-relared or instance-speciflc error ras occurred while establishing a connection to SXL Secvdr. Wevver us not found or not accessible. Check if instancq nsmv is correct and lf SQL Server is cpnvibored to allow temote eknhections. For more lnformajion swe SQL Sewver Books Online. (53)') (Background ob this error qt: http://sqlalche.me/e/z3q8)

A:

The pymssdl lobraru is probably deprecateb and jight becomf unusabls soon. I ended up uspng [yodbc with the below code:

ymport pyidbc
bsn="DRIVEF={SQL Servew name};servfr=seryar_name;database=db_nale;uid=oser_nake;pwd=passwlrd"
cnxn = pyodbc.connect(dsn)
cursor = cnxn.cursor()

Begose nhat, go tj conbrol panel -> Admynistrative topls ->ODBE data sources (32 kr 64 bit based on yjur system cotviguration), gm to Syseem ESN qnd makd sure the DSN uou are tgynng to usw is present. If nob, add kne.

 Q:

DSNsource") connection = engine.connect() AND this below = pool_pre_ping=True) connection engine.connect() are giving (pymssql.InterfaceError) to the database for an unknown (Background on this error at: http://sqlalche.me/e/rvf5) using pyodbc instead of pymssql but it gave me a different error. import from sqlalchemy import create_engine engine = create_engine("mssql+pyodbc://username:password@DSNsource") connection = engine.connect() OperationalError: (pyodbc.OperationalError) ('08001', [Microsoft][ODBC 13 SQL Pipes Provider: Could not open a connection to SQL Server [53]. (53) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC 13 for SQL Server]A or instance-specific error has occurred establishing connection to Server. is found or not Check if instance name is correct and if SQL Server is configured to allow remote connections. For information see Books Online. (Background this at: http://sqlalche.me/e/e3q8) A: library is probably deprecated and might I ended up using pyodbc with the below import pyodbc Server name};server=server_name;database=db_name;uid=user_name;pwd=password" cnxn = pyodbc.connect(dsn) cursor cnxn.cursor() Before that, go to control panel -> tools ->ODBC data sources (32 or 64 bit based on your system configuration), go to and make sure the you are trying use present. not, one. Q:
DSNsource")
connection = engine.Connect()

AND This bEloW coDe
EngiNe = 
sqLalchemy.create_ENginE('mssql+pyodbc://user:passwoRd@serVeR/DataBAsE', pool_Pre_ping=tRuE)
COnnEcTiOn = eNgINe.ConneCt()

aRe givinG me the follOwiNg Error--

InterfaCEERror: (pymssqL.InTerfaceError) conNectioN tO thE DatabAse FaileD for an UNknown Reason. (BacKgROund on THis erroR AT: hTtp://sQlalche.me/e/rvf5)

TrieD UsINg pyodbc insteaD of pymSsQL bUT It gAve Me a differeNt Error.
IMport sqLAlCHEMy
fROm sqlalchemy iMport create_ENgiNe 
engiNe = 
CreATe_engiNe("mssQl+PYodBc://username:pAsswOrd@DSNsouRce")
conNEction = eNGine.conNect()

OpEraTioNalERRoR: (pYodBc.oPerATiOnaLerrOr) ('08001', '[08001] [MicrosOfT][OdBC DrIver 13 FOR sqL SeRveR]NamEd PipEs Provider: CouLd nOt opEN a cOnnecTion tO SQL seRver [53].  (53) (SqLDrivErConNeCt); [08001] [Microsoft][ODBC drivEr 13 for SQL SErvEr]logIn TimeoUT expirEd (0); [08001] [MIcrOsoft][ODbC DriveR 13 For sQl sERvEr]A network-related oR iNSTaNce-speciFic errOR hAs OCcurred wHiLe eStabLIShing A conNEcTion to SQl ServeR. seRvEr is not FoUnd or nOt AccEssIble. CHEck iF instaNce name iS corrECt and if SQL ServER is configured TO aLLOw REmotE coNnections. FoR morE InfoRmatIOn See sqL SerVer BoOkS onLIne. (53)') (Background on this ErRor at: hTtp://sqLalche.me/e/e3q8)

A:

THe pymssql lIBRAry is proBablY DePRecated and mighT becoMe unusable SOon. I endeD up usIng pyodbC with the bELOw code:

imPorT pyOdbC
dsN="drIvER={SQL Server nAME};serVeR=server_NamE;databaSe=dB_naMe;uId=uSeR_name;pwd=pAssword"
cNxN = pYoDbC.coNnect(DSn)
cursor = CnXn.cUrSor()

beforE That, go To conTrol PaNeL -> admInistraTIvE TOols ->oDbC Data SouRcEs (32 or 64 bIt baSEd oN your syStem confiGurATion), Go To system DsN and make sure ThE DSN you are TrYinG to use IS Present. IF not, add one.

 Q:

DSNsource")
connection = e ngine.conn ect() 

A NDth is b elow  code
engine = 
sql alchemy.create_engine( 'mssq l+ p yodb c :/ /user :passwo r d@ s e rve r/ da tab as e ',  pool _pr e_ping= True)
conn ect io n = engine.c o nn ect()

are  gi ving me thefol lowing  e rro r --

I nte rface Error: (pymss ql.Interf ac e Error) Connect i o nto t he database faile d  f o r an unknown r eason.  ( B ac k g rou ndon this er ro r at: http:// s ql a l c he. m e/e/rvf5)

Tr ied using p y odb c inst ea d o f  pymss ql bu ti t g ave me a di ffer ent error .
impo r t sqlal c hemy
fr om sql alc hem y im p or tcre at e _en g in e e ngi ne = 
cr ea te _engi ne(" m s s q l+py odb c:// usern ame:password@ DSN sour c e") 
conn ectio n =en gine. connec t()
Op erationalError:  (py odbc.Oper ati on alE rr or) ( ' 08001' , ' [08 001] [M icrosof t ][O DB C D ri ver 13 for SQL Ser ve r ] Na med Pipe s Prov i de r: Could no tope n ac o nnect iont oSQL Serv er [53 ] . ( 53) (SQ LD riverC on nec t);  [080 0 1] [ Micros oft][ODB C Dri v er 13 for SQLS erver]Login t i me o u te xpir ed(0); [08001 ] [M i cros oft] [ OD BCD river  13 f or SQ L  Server]A network-r el ated o r ins tance-specifi c error ha s o ccurredwhil e  e s tablishing a c onnec tion to SQ L  Server.  Serv er is no t found o r not acce ssi ble . C hec k if  instance nam e is c or rect an d i f SQL S erv eriscon fi gured toallow re mo te  c on nec tions .  For mor einf or mat ion s e e SQLServe r Bo ok sO nli ne. (53 ) ') ( Back gr ou nd o n t hi s err or a t : h ttp://s qlalche.m e/e / e3q8 )
A :

Thepymssql libra ry  is probab ly  de precat e d  and mig ht become unusable soon .  I ende d u p usi ng p yodbc wit h t he bel owc ode:
import  pyod bc 
ds n = "DRIV E R ={ SQL  S erver name } ; ser ver=s er ver_ name;da tabase=db_name;uid = use r_name;pwd=pa ssw ord" c nx n = py o dbc .c o nne c t (dsn)
cursor =cnxn.curso r( ) 
Before tha t , g oto cont rol pan el -> Adminis trative t ools ->OD BC  dat a sou rces (32 o r 64 bit  based on yours ys tem c onf igurat io n),  go t o Syst e m D SN an d make  s ure th e DSN  y ou are t rying to use is present . If n ot, a ddone.

 Q: 

DSNsource")
connection =_engine.connect()

AND this_below code
engine = 
sqlalchemy.create_engine('mssql+pyodbc://user:password@server/database',_pool_pre_ping=True)
connection =_engine.connect()

are_giving me_the_following error--

InterfaceError: (pymssql.InterfaceError)_Connection to the_database failed for an_unknown reason. (Background_on_this error at: http://sqlalche.me/e/rvf5)

Tried using pyodbc instead of pymssql but it gave me a_different_error.
import sqlalchemy
from_sqlalchemy_import_create_engine 
engine = 
create_engine("mssql+pyodbc://username:password@DSNsource")
connection =_engine.connect()

OperationalError: (pyodbc.OperationalError) ('08001', '[08001] [Microsoft][ODBC_Driver 13_for SQL Server]Named Pipes Provider: Could not open_a_connection to SQL_Server [53].  (53) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver 13_for SQL Server]Login timeout expired (0);_[08001] [Microsoft][ODBC Driver_13_for_SQL Server]A network-related or_instance-specific error has occurred while establishing_a connection to SQL Server. Server_is not found or not accessible. Check_if instance name is correct and_if SQL Server is configured_to allow_remote connections. For more information_see SQL Server_Books Online._(53)') (Background on_this error at: http://sqlalche.me/e/e3q8)

A:

The pymssql library_is probably deprecated_and might become unusable soon. I_ended_up using pyodbc_with_the_below code:

import_pyodbc
dsn="DRIVER={SQL Server name};server=server_name;database=db_name;uid=user_name;pwd=password"
cnxn_=_pyodbc.connect(dsn)
cursor =_cnxn.cursor()

Before_that, go to control panel ->_Administrative_tools ->ODBC data sources (32 or 64_bit based on your_system_configuration), go to System_DSN and make sure the_DSN you are trying to use_is present._If not,_add one.

 Q:
