Question

After syncdb creates the tables I get an error when enabling the constraints:

Installing custom SQL ...
Installing indexes ...
DatabaseError: (-2147352567, 'Exception occurred.', (0, u'Microsoft SQL Server N
ative Client 10.0', u'Query timeout expired', None, 0, -2147217871), None)
Command:
EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"
Parameters:
[]

But when running the below command manually against the same database after the tables have been created, it runs without errors:

EXEC sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"

The database contains hundreds of tables that are not generated by Django itself. Running syncdb against an empty MSSQL database does not produce this error. Could this be a timeout caused by too many tables in the database? If so, would I resolve it? I'm using the django-mssql drivers.

Was it helpful?

Solution

change parameter COMMAND_TIMEOUT in config database Setting.py Example:

'COMMAND_TIMEOUT': Numberseconds
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top