英文:
Django - want to use inspectdb to get only one table. Using MS SQL Server
问题
I've been testing the inspectdb with django 4.0. If I do "python manage.py inspectdb --database MSDatabase," it tries to bring all table info into the model. Is there a way to select only a few or one table?
The DB server is MS SQL Server. The database is MSDatabase, the schema is MySchema, and the table name is MYTBL.
I tried "python manage.py inspectdb --database MSDatabase MYTBL" and got the table not found error.
英文:
I've been testing the inspectdb with django 4.0. If I do "python manage.py inspectdb --database MSDatabase", it tries to bring all table info into the model. Is there a way to select only few or one tables?
The DB server is MS SQL Server. The database is MSDatabase, the schema is MySchema, and the table name is MYTBL.
I tried "python manage.py inspectdb --database MSDatabase MYTBL" and got the table not found error.
答案1
得分: 1
你可以将表格的名称传递给它。
python manage.py inspectdb table1
或者多个表格
python manage.py inspectdb table1 table2
英文:
You can pass the name of the table to do it.
python manage.py inspectdb table1
Or multiple tables
python manage.py inspectdb table1 table2
Here's the the link to inspectdb documention for Django 4.0.
答案2
得分: 0
对我来说,这个方法有效。
python manage.py inspectdb --database MyDb table1
英文:
For me this worked.
python manage.py inspectdb --database MyDb table1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论