I recently installed Microsoft SQL Server 2014 on my PC, because I want to create a database for the web application that I have been creating (I studied Python for a year and had very simple experience with SQLite).
After installing SQL Server 2014 and creating a database called Users, I just try to run some very simple commands in my database, but again and again I run into the first hurdle!
I installed pymssql and pyodbc and tried to run the commands directly with them, but could not. (for example, pymssql gives me a TypeError argument: the type "NoneType" is not iterable when I set the variable conn = pymssql.connect (server, user, password, "tempdb")
My last attempt was to use SQLalchemy to achieve my long awaited connection to the SQL database. However, after setting this parameter, it does not work with the following error: "sqlalchemy.exc.OperationalError: (pymssql.OperationalError) (20009," DB-Lib 20009 error message, severity 9: \ nUnable for connection: Adaptive Server unavailable or does not exist \ nNet-Lib error during unknown error (10035) \ n ') "
The question I need is how do I start a conversation with my database using SQLalchemy?
The code I use is as follows: from sqlalchemy * import
engine = create_engine('mssql+pymssql://Han & Lew:@SlugarPlum:1433/Users')
m = MetaData()
t = Table('t', m,
Column('id', Integer, primary_key=True),
Column('x', Integer))
m.create_all(engine)
, SlugarPlum. . THELROYSERVER. DSN = 1433. . ( , , , , , , , .)
, - - Python-SQL, , , !