django-mssql

Django query to join records of two tables

北城以北 提交于 2019-12-24 17:08:20
问题 I am using django-mssql 1.6.2 package with django 1.7 to get one or several records of tables from sql server 2008. When I call "get" or "filter" as follows, everything is fine but my server program is very slow. Consider the following tables: class Contact(models.Model): id = models.IntegerField(primary_key=True, unique=True, null=False) address = models.CharField(max_length = 100) phone = models.IntegerField(unique=True) class Parent(models.Model): id = models.IntegerField(primary_key=True,

Establishing connection to MS SQL Server 2014 with django-mssql-1.6

瘦欲@ 提交于 2019-12-21 05:28:42
问题 i am aware that the django-mssql-1.6/README states: SQL Server Versions Supported Versions: 2008 2008r2 2012 but, seeing as v. 1.6 is the latest version available, i was wondering if anyone was able to find a way to connect to an MS SQL Server 2014. I am trying, but getting the error message: django.db.utils.OperationalError: (com_error(-2147352567, 'Exception occurred.', (0, u'ADODB.Connection', u'Provider cannot be found. It may not be properly installed.', u'C:\Windows\HELP\ADO270.CHM',

django-mssql on debian linux

ⅰ亾dé卋堺 提交于 2019-12-13 09:13:36
问题 Anyone has success on install django-mssql on linux machine? My deploy server is debian linux and I cant deploy my applications made on windows machine. I have troubes on my legacy latin1 database on acess it from pyodbc on django, Anyone has a solve to it? 回答1: Pywin32 is a requirement. I don't believe there is a way of getting that installed and working on debian linux. Django-mssql requirements 回答2: Actually,there is a workaround with ODBC interface. Install Microsoft ODBC Driver 1.0 for

Query timeout expired in django-mssql when executing custom SQL directly

匆匆过客 提交于 2019-12-12 16:24:52
问题 I am querying a view which will return huge data and takes more than 1 minute to complete. I am executing the query with django.db.connection.cursor() since this is not my default db. After 30 seconds I am getting an exception 'Query timeout expired'. I think 30 seconds is the default timeout of django-mssql. Is there a way to increase timeout period or is there any other way. Can't work on SQL query because it is implemented by another party. Only a view is exposed. str(Exception) is "(

Unable to connect to MSSQL database via django-mssql

核能气质少年 提交于 2019-12-12 05:39:29
问题 I'm trying to connect to my Microsoft SQL Server database from django but I am getting the following error when running the web server using django-mssql PS N:\Documents\Python> python .\manage.py check Traceback (most recent call last): File ".\manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 353, in execute_from_command_line utility.execute() File "C:\Python27\lib\site-packages\django\core

How to write ms sql code for two column with same datas in MS SQL

霸气de小男生 提交于 2019-12-12 04:10:11
问题 Here it two table. Table1 SchoolID Teacher_name comm_yr 01 John 1990 02 Heley 1995 03 George 1994 04 Chris 1998 05 Mary 1993 Table2 School_ID Student_name 01 Heley 02 Chris 03 Chris 04 Mary 05 Heley I would like to list the year each student has done as student and the year each student has done as teacher. SELECT Teacher_name, comm_yr As Teacher_comm_yr, comm_yr As Student_comm_yr FROM Table1 INNER JOIN Table2 WHERE comm_yr (SELECT comm_yr As Teacher_comm_yr From Table1 Where teacher_name

django-mssql not working in Apache w/ mod-wsgi, but works fine in dev server

佐手、 提交于 2019-12-11 03:08:39
问题 I have a Django application using django-mssql to communicate w/ SQL Server. This works just fine in the dev server (runserver) but under Apache/mod-wsgi, I get a fail related to it trying to find a .dll which does exist: [Thu May 19 15:35:09 2011] [error] [client 127.0.0.1] File "C:\\Python27\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 98, in __import_pywin32_system_module__ [Thu May 19 15:35:09 2011] [error] [client 127.0.0.1] raise ImportError("No system module '%s' (%s)" %

Error “sqlserver_ado isn't an available database backend” (PyISAPIe on IIS)

廉价感情. 提交于 2019-12-10 18:57:48
问题 I'm having problems connecting my Django project to SQL Server 2008 when using IIS to serve Django and django-mssql to handle transactions. I am using IIS 7 and 64 bit ActivePython 2.7. Here is my list of installed packages: Django==1.4.5 distribute==0.6.19 django-mssql==1.2 pypm==1.3.4 pythonselect==1.3 pywin32==214 virtualenv==1.6.1 wsgiref==0.1.2 And here is the last bit of the stack trace: File "C:\Python27\lib\site-packages\django\db\__init__.py", line 40, in backend = load_backend

django-pyodbc vs django-mssql

 ̄綄美尐妖づ 提交于 2019-12-10 13:53:21
问题 It's in the title really. I want to run Django against MSSQL 2005. Both look reasonably active and up to date. I can't seem to see any unique points for either. Can anyone recommend one over the other? Would it be trivial to swap between the two at a later date? Are they production-ready? Thanks! 回答1: My choose is django-pyodbc because of cross-platform requirements. django-mssql runs only on Windows. Django-pyodbc works with South. Django-pyodbc has some bugs and pyodbc itself too. I've

pywintypes27.dll not found using Apache, Django, pywin32, Python2.7 and mod_wsgi

Deadly 提交于 2019-12-07 08:44:11
问题 I have a Django application using django-mssql to communicate w/ SQL Server. This works just fine in the dev server (runserver) but under Apache/mod-wsgi, I get a error related to it trying to find a .dll which does exist: Exception Type: ImportError Exception Value: No system module 'pywintypes' (pywintypes27.dll) Exception Location: C:\Python27\lib\site-packages\win32\lib\pywintypes.py in __import_pywin32_system_module__, line 98 Python Executable: C:\Program Files (x86)\Apache Software