Home  >  Q&A  >  body text

Python操作sqlserver是异步的吗?

我用pymssql操作sqlserver,执行了一条sql插入语句,然后查询这条刚插入的记录的某个自动生成的字段,有时候会发生查询不到的情况
已经设置为autocommit了,或者说插入语句有没有返回当前行的所有字段的用法啊?这样我就不用再去查了

ringa_leeringa_lee2741 days ago576

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 10:32:11

    cur.lastrowid can get the last inserted id. Generally, this is obtained based on the connection. The insertion of other connections will not affect the obtained value

    reply
    0
  • Cancelreply