Django MSSQL Documentation



Similar documents
Django MSSQL Documentation

EventSentry Overview. Part I Introduction 1 Part II Setting up SQL 2008 R2 Express 2. Part III Setting up IIS 9. Part IV Installing EventSentry 11

Installing GFI Network Server Monitor

django-gcm Documentation

MS SQL Express installation and usage with PHMI projects

Training module 2 Installing VMware View

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

FaxCore 2007 Application-Database Backup & Restore Guide :: Microsoft SQL 2005 Edition

Using SQL-server as database engine

R i o L i n x s u p p o r r i o l i n x. c o m 1 / 3 0 /

LDaemon. This document is provided as a step by step procedure for setting up LDaemon and common LDaemon clients.

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

Immotec Systems, Inc. SQL Server 2005 Installation Document

for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later

Django FTP server Documentation

Setup and configuration for Intelicode. SQL Server Express

MIGRATING TO AVALANCHE 5.0 WITH MS SQL SERVER

SQL 2012 Installation Guide. Manually installing an SQL Server 2012 instance

ODBC Client Driver Help Kepware, Inc.

How to Use PIPS Access to/from SQL Database Utility Program. By PIPSUS Support Team Dr. Chouikha

Installing Cobra 4.7

Using SQL Server Management Studio

Installing Kaspersky Security Center 10.0 on Microsoft Windows Server 2012 Core Mode

Installation procedure for Chromis REC for 3CX

LANDESK Service Desk. Desktop Manager

Using Microsoft Windows Authentication for Microsoft SQL Server Connections in Data Archive

Novar Database Mail Setup Guidelines

Issue Tracking Anywhere Installation Guide

Sitecore Ecommerce Enterprise Edition Installation Guide Installation guide for administrators and developers

Video Administration Backup and Restore Procedures

ICONICS Using the Azure Cloud Connector

Git - Working with Remote Repositories

Safexpert Installation instructions MS SQL Server 2008 R2

Upgrade Guide BES12. Version 12.1

TROUBLESHOOTING GUIDE

Kerio Exchange Migration Tool

Avatier Identity Management Suite

for Networks Installation Guide for the application on a server September 2015 (GUIDE 2) Memory Booster version 1.3-N and later

Installing The SysAidTM Server Locally

Microsoft SQL connection to Sysmac NJ Quick Start Guide

QUANTIFY INSTALLATION GUIDE

GFI LANguard 9.0 ReportPack. Manual. By GFI Software Ltd.

GFI LANguard 9.0 ReportPack. Manual. By GFI Software Ltd.

django-cron Documentation

latest Release 0.2.6

Nexio Connectus with Nexio G-Scribe

Table of Contents SQL Server Option

KonyOne Server Prerequisites _ MS SQL Server

InfoRouter LDAP Authentication Web Service documentation for inforouter Versions 7.5.x & 8.x

Installation Instructions for Hospital ERP System (AP) Installation Instructions for Hospital ERP System (AP)

FaxCore 2007 Database Migration Guide :: Microsoft SQL 2008 Edition

Alert Notification of Critical Results (ANCR) Public Domain Deployment Instructions

Installing Windows Server Update Services (WSUS) on Windows Server 2012 R2 Essentials

EntroWatch - Software Installation Troubleshooting Guide

Moving the TRITON Reporting Databases

Network Load Balancing

Reconfiguring VMware vsphere Update Manager

IIS, FTP Server and Windows

Server-side Development using Python and SQL

Introducing SQL Server Express

Insight Video Net. LLC. CMS 2.0. Quick Installation Guide

NovaBACKUP xsp Version 15.0 Upgrade Guide

FaxCore Ev5 Database Migration Guide :: Microsoft SQL 2008 Edition

MS SQL Server Database Management

Installing Red Hat Enterprise Virtualization Manager RHEV-M on Windows 2008 R2.

Using MS-SQL Server with Visual DataFlex March, 2009

Installing and activating the DCA

Implementing Microsoft SQL Server 2008 Exercise Guide. Database by Design

RSA Security Analytics

USER GUIDE. Snow Inventory Data Receiver Version 2.1 Release date Installation Configuration Document date

Connecticut Hazardous Waste Manifests Database

Connecting to SQL server

Knowledge Base Article: Article 218 Revision 2 How to connect BAI to a Remote SQL Server Database?

Appendix L: Running Hazus-MH with SQL Server 2005

2.3 - Installing the moveon management module - SQL version

Customer Tips. Configuring Color Access on the WorkCentre 7328/7335/7345 using Windows Active Directory. for the user. Overview

CONFIGURING SQL SERVER FOR METRIX

Aradial Installation Guide

Microsoft SQL Server Staging

McAfee One Time Password

How-To: MySQL as a linked server in MS SQL Server

Enterprise Server Setup Guide

Configuring Network Load Balancing with Cerberus FTP Server

Bitrix Site Manager ASP.NET. Installation Guide

WhatsUp Gold v16.3 Installation and Configuration Guide

Administering the Web Server (IIS) Role of Windows Server

MBA Dedicated Servers: A How-to Guide

Burst Technology bt-loganalyzer SE

Installing and configuring Microsoft Reporting Services

Nexio Connectus Cluster Set Up with SQL Server Backend

Click Studios. Passwordstate. High Availability Installation Instructions

Asta Development. Product Installation Guide

MyMoney Documentation

Two new DB2 Web Query options expand Microsoft integration As printed in the September 2009 edition of the IBM Systems Magazine

Team Foundation Server 2012 Installation Guide

How To Set Up Ops Cser.Com (Pros) For A Pc Or Mac) With A Microsoft Powerbook (Proos) (Prosecco) (Powerbook) (Pros) And Powerbook.Com/

Transcription:

Django MSSQL Documentation Release dev Django MSSQL authors April 25, 2012

CONTENTS i

ii

Provides an ADO based Django database backend for Microsoft SQL Server. CONTENTS 1

2 CONTENTS

CHAPTER ONE WELCOME TO DJANGO-MSSQL S DOCUMENTATION! Contents: 1.1 Quickstart 1.1.1 Installation Install django-mssql with your favorite Python package manager: pip install django-mssql Add the DATABASES configuration. DATABASES = { default : { NAME : my_database, ENGINE : sqlserver_ado, HOST : dbserver\\ss2008, USER :, PASSWORD :, OPTIONS : { provider : SQLOLEDB, use_mars : True, }, } } Note: Although the project is named django-mssql the python module is named sqlserver_ado. 1.1.2 Dependencies Django Django 1.2 and newer are supported by the current release. Support for Django 1.1 requires getting code from tag legacy-1.1. 3

Python This backend requires Python 2.6 or newer. Python 3.x support will be investigated when Django supports it. PyWin32 PyWin32 build 212 or newer is required. 1.2 Settings 1.2.1 DATABASES Please see the Django documentation on DATABASES settings for a complete list of available settings. Django-mssql builds upon these settings. This is an example of a typical configuration: DATABASES = { default : { NAME : my_database, ENGINE : sqlserver_ado, HOST : dbserver\\ss2008, USER :, PASSWORD :, OPTIONS : { provider : SQLOLEDB, use_mars : True, }, } } ENGINE This value must be set to sqlserver_ado. HOST Default: 127.0.0.1 This defines the Microsoft SQL Server to establish a connection. This value can be a hostname or IP address. PORT Default: (Empty string) This defines the network port to use when connecting to the server. If not defined, the standard Microsoft SQL Server port will be used. 4 Chapter 1. Welcome to Django-mssql s documentation!

NAME This is the name of the SQL server database. USER Default: (Empty string) This defines the name of the user to use when authenticating to the server. When empty, a trusted connection (SSPI) will be used. PASSWORD Default: (Empty string) When a USER is defined, this field should be the plain text password to use when authenticating. 1.2.2 OPTIONS Django-mssql provides a few extra OPTIONS that are specific to this backend. use_mars Default: False Set to True to enable Multiple Active Recordsets. It is recommended to enable MARS to avoid seeing the Cannot create new connection because in manual or distributed transaction mode error. extra_params Default: (Empty string) This value will be appended to the generated connection string. Use this to provide any specific connection settings that are not controllable with the other settings. provider Default: SQLOLEDB The SQL provider to use when connecting to the database. 1.3 Management Commands Adding sql_app to your INSTALLED_APPS adds the following custom management commands. 1.3. Management Commands 5

1.3.1 dbgui This will launch SQL Management Studio, connected to your project s default database. python manage.py dbgui 1.4 Datatypes There are known issues related to Python/DB data types. 1.4.1 Dates and Times Earliest Year SQL Server provides two datetime types: datetime and smalldatetime. This backend always uses datetime, which supports dates back to January 1, 1753. Django previously only supported dates back to 1900, but recent revisions 7946 + 7950 changed this behavior. If you need to store historical data in datetime fields, then SQL Server 2005 will have a problem. (I d welcome bugs/repro cases/patches on this issue.) SQL Server 2008 introduces a datetime2 type, with support for fractional seconds and the full range of Python datetime dates. To use this time, edit your local creation.py/introspection.py files to use this datatype instead. Bare Times SQL Server 2005 doesn t have a bare time datatype, only a datetime. SQL Server 2008 introduces a time type, but this isn t used by this backend. 1.4.2 bigint Prior to Django 1.3, bigint was not provided. This backend provided model fields to allow using the bigint datatype. class sqlserver_ado.fields.bigautofield This is a django.db.models.autofield for the bigint datatype. class sqlserver_ado.fields.bigintegerfield This was previously an django.db.models.integerfield that specified the bigint datatype. As of Django 1.3, django.db.models.bigintegerfield is provided and should be used instead. class sqlserver_ado.fields.bigforeignkey This is a django.db.models.foreignkey that should be used to reference either a BigAutoField or a BigIntegerField. 6 Chapter 1. Welcome to Django-mssql s documentation!

1.4.3 Unsupported Types These types may behave oddly in a Django application, as they have limits smaller than what Django expects from similar types: smalldatetime smallmoney tinyint real 1.5 Testing All tests are contained in the tests folder. 1.5.1 DB-API The folder tests/api/ contains a test suite for checking DB-API 2 conformance. 1.5.2 Django Support Database Introspection Located in folder tests/test_inspectdb. These tests verify the database introspection. To run: set up the SQLINSTANCE python manage.py inspectdb Main Tests The tests for basic functionality and regressions are located in the tests/test_main/ folder. To run: set up the SQLINSTANCE python manage.py test 1.5. Testing 7