使用sqlalclhemy執行插入數據時報下面的錯:
b'Cannot find the object "Products" because it does not exist or you do not have permissions
模型中表結構如下:
class Products(db.Model):
ID = db.Column(db.Integer, primary_key=True)
除了插入外,查詢、修改、刪除都正常,權限也正常。
通過顯示SQL命令,發現在執行 SET IDENTITY_INSERT [Products] ON 后報錯。