sqlobject.mssql.mssqlconnection module — SQLObject 3.9.1 documentation

# sqlobject.mssql.mssqlconnection module

class `sqlobject.mssql.mssqlconnection.` `MSSQLConnection`(db, user, password='', host='localhost', port=None, autoCommit=0, **kw)

  Bases: `sqlobject.dbconnection.DBAPI`

  `HAS_IDENTITY` = "\n select 1\n from INFORMATION_SCHEMA.COLUMNS\n where TABLE_NAME = '%s'\n and COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') = 1\n "
  `SHOW_COLUMNS` = "\n select\n name,\n length,\n ( select name\n from systypes\n where cast(xusertype as int)= cast(sc.xtype as int)\n ) datatype,\n prec,\n scale,\n isnullable,\n cdefault,\n m.text default_text,\n isnull(len(autoval),0) is_identity\n from syscolumns sc\n LEFT OUTER JOIN syscomments m on sc.cdefault = m.id\n AND m.colid = 1\n where\n sc.id in (select id\n from sysobjects\n where name = '%s')\n order by\n colorder"
  `SHOW_TABLES` = "SELECT name FROM sysobjects WHERE type='U'"
  `addColumn`(tableName, column)
  `can_use_max_types`()
  `can_use_microseconds`()
  `columnsFromSchema`(tableName, soClass)
  `createColumn`(soClass, col)
  `createIDColumn`(soClass)
  `createIndexSQL`(soClass, index)
  `createReferenceConstraint`(soClass, col)
  `dbName` = 'mssql'
  `delColumn`(sqlmeta, column)
  `guessClass`(t, size, precision, scale)

    Here we take raw values coming out of syscolumns and map to SQLObject class types.

  `insert_id`(conn)

    insert_id method.

  `joinSQLType`(join)
  `limit_re` = re.compile('^\\s*(select )(.*)', re.IGNORECASE)
  `makeConnection`()
  `odbc_keywords` = ('Server', 'Port', 'User Id', 'Password', 'Database')
  `schemes` = ['mssql']
  `server_version`()

    Get server version: 8 - 2000 9 - 2005 10 - 2008 11 - 2012 12 - 2014 13 - 2016

  `supportTransactions` = True
  `tableExists`(tableName)