Profile

Join date: May 18, 2022

About

Kingdom Telefone: +441223920000 +441223910000 E-mail: enquiry@datasoft.es Desenvolvedores DATASOFT Recibo por email:Q: How to get the last



 

Baixar Controladores Usb Barramento Serial Universal


Download


 





Contact Caixa Postal 48000-093 Martinslade Dorset Dorset United Kingdom Telefone: +441223920000 +441223910000 E-mail: enquiry@datasoft.es Desenvolvedores DATASOFT Recibo por email:Q: How to get the last inserted record id in a python script in SQL Server database? I have used the python programming language to insert data into a SQL Server table from a HTML form, using requests and sqlalchemy. I want to retrieve the id of the last inserted record. The problem is that I am not able to get the id. To insert data I used the following code: import requests import sqlalchemy connection = sqlalchemy.create_engine('mssql+pyodbc://@localhost:1433/DB1', echo=False) sql_statement = "INSERT INTO BLO(Blo) VALUES('lk')" response = requests.post("", data={"insert_request_to_sql": sql_statement, "insert_value": "test"}, headers={'Content-Type': 'application/x-www-form-urlencoded'}) print(response.text) connection.commit() print("Done inserting data.") print('Connection ID:', connection.connection.connection_id) As I understand the connection_id is the "ID" of the last inserted row, but it is not returned by my script. How can I get this information? A: You have to commit your transaction, by calling connection.commit(): response = requests.post("",




ee43de4aa9

B

Baixar Controladores Usb Barramento Serial Universal

More actions