### Home Classes Methods

### In Files

- lib/sequel/adapters/shared/mssql.rb

### Methods

- ::new
- #_import
- #aggregate_dataset
- #complex_expression_sql_append
- #constant_sql_append
- #delete_clause_methods
- #delete_from2_sql
- #delete_from_sql
- #delete_output_sql
- #disable_insert_output
- #disable_insert_output!
- #first_primary_key
- #format_timestamp_usec
- #full_text_search
- #insert_clause_methods
- #insert_output_sql
- #insert_select
- #into
- #is_2005_or_later?
- #literal_blob_append
- #literal_false
- #literal_string_append
- #literal_true
- #multi_insert_sql
- #nolock
- #output
- #output!
- #output_sql
- #quoted_identifier_append
- #select_clause_methods
- #select_into_sql
- #select_limit_sql
- #select_lock_sql
- #server_version
- #supports_group_cube?
- #supports_group_rollup?
- #supports_insert_select?
- #supports_intersect_except?
- #supports_is_true?
- #supports_join_using?
- #supports_modifying_joins?
- #supports_multiple_column_in?
- #supports_output_clause?
- #supports_where_true?
- #supports_window_functions?
- #update_clause_methods
- #update_from_sql
- #update_output_sql
- #update_table_sql

### Included Modules

- EmulateOffsetWithRowNumber

### Files

- CHANGELOG
- MIT-LICENSE
- README.rdoc
- active_record.rdoc
- advanced_associations.rdoc
- association_basics.rdoc
- cheat_sheet.rdoc
- dataset_basics.rdoc
- dataset_filtering.rdoc
- mass_assignment.rdoc
- migration.rdoc
- model_hooks.rdoc
- opening_databases.rdoc
- prepared_statements.rdoc
- querying.rdoc
- reflection.rdoc
- 1.0.txt
- 1.1.txt
- 1.3.txt
- 1.4.0.txt
- 1.5.0.txt
- 2.0.0.txt
- 2.1.0.txt
- 2.10.0.txt
- 2.11.0.txt
- 2.12.0.txt
- 2.2.0.txt
- 2.3.0.txt
- 2.4.0.txt
- 2.5.0.txt
- 2.6.0.txt
- 2.7.0.txt
- 2.8.0.txt
- 2.9.0.txt
- 3.0.0.txt
- 3.1.0.txt
- 3.10.0.txt
- 3.11.0.txt
- 3.12.0.txt
- 3.13.0.txt
- 3.14.0.txt
- 3.15.0.txt
- 3.16.0.txt
- 3.17.0.txt
- 3.18.0.txt
- 3.19.0.txt
- 3.2.0.txt
- 3.20.0.txt
- 3.21.0.txt
- 3.22.0.txt
- 3.23.0.txt
- 3.24.0.txt
- 3.25.0.txt
- 3.26.0.txt
- 3.27.0.txt
- 3.28.0.txt
- 3.29.0.txt
- 3.3.0.txt
- 3.30.0.txt
- 3.31.0.txt
- 3.32.0.txt
- 3.33.0.txt
- 3.4.0.txt
- 3.5.0.txt
- 3.6.0.txt
- 3.7.0.txt
- 3.8.0.txt
- 3.9.0.txt
- schema_modification.rdoc
- sharding.rdoc
- sql.rdoc
- testing.rdoc
- transactions.rdoc
- validations.rdoc
- virtual_rows.rdoc

### Class Index

Quicksearch

- Sequel
- Sequel::ADO
- Sequel::ADO::Database
- Sequel::ADO::Dataset
- Sequel::ADO::MSSQL
- Sequel::ADO::MSSQL::DatabaseMethods
- Sequel::ADO::MSSQL::Dataset
- Sequel::ASTTransformer
- Sequel::Access
- Sequel::Access::DatabaseMethods
- Sequel::Access::DatasetMethods
- Sequel::Adapter
- Sequel::AdapterNotFound
- Sequel::AdapterNotFound
- Sequel::Amalgalite
- Sequel::Amalgalite::Database
- Sequel::Amalgalite::Dataset
- Sequel::Amalgalite::SequelTypeMap
- Sequel::ArbitraryServers
- Sequel::BasicObject
- Sequel::ColumnsIntrospection
- Sequel::ConnectionPool
- Sequel::ConnectionPool::ClassMethods
- Sequel::DB2
- Sequel::DB2::DB2Error
- Sequel::DB2::Database
- Sequel::DB2::DatabaseMethods
- Sequel::DB2::Dataset
- Sequel::DB2::DatasetMethods
- Sequel::DBI
- Sequel::DBI::Database
- Sequel::DBI::Dataset
- Sequel::DataObjects
- Sequel::DataObjects::Database
- Sequel::DataObjects::Dataset
- Sequel::DataObjects::MySQL
- Sequel::DataObjects::MySQL::DatabaseMethods
- Sequel::DataObjects::MySQL::Dataset
- Sequel::DataObjects::Postgres
- Sequel::DataObjects::Postgres::AdapterMethods
- Sequel::DataObjects::Postgres::DatabaseMethods
- Sequel::DataObjects::Postgres::Dataset
- Sequel::DataObjects::SQLite
- Sequel::DataObjects::SQLite::DatabaseMethods
- Sequel::DataObjects::SQLite::Dataset
- Sequel::Database
- Sequel::DatabaseConnectionError
- Sequel::DatabaseDisconnectError
- Sequel::DatabaseError
- Sequel::Dataset
- Sequel::Dataset
- Sequel::Dataset::ArgumentMapper
- Sequel::Dataset::BindArgumentMethods
- Sequel::Dataset::Pagination
- Sequel::Dataset::PreparedStatementMethods
- Sequel::Dataset::QueryBlockCopy
- Sequel::Dataset::StoredProcedureMethods
- Sequel::Dataset::StoredProcedures
- Sequel::Dataset::TYPE_TRANSLATOR
- Sequel::Dataset::UnnumberedArgumentMapper
- Sequel::EmulateOffsetWithRowNumber
- Sequel::Error
- Sequel::Firebird
- Sequel::Firebird::Database
- Sequel::Firebird::DatabaseMethods
- Sequel::Firebird::Dataset
- Sequel::Firebird::DatasetMethods
- Sequel::HookFailed
- Sequel::HookFailed
- Sequel::IBMDB
- Sequel::IBMDB::Connection
- Sequel::IBMDB::Connection::Error
- Sequel::IBMDB::Database
- Sequel::IBMDB::Dataset
- Sequel::IBMDB::Dataset::CallableStatementMethods
- Sequel::IBMDB::Dataset::PreparedStatementMethods
- Sequel::IBMDB::Statement
- Sequel::Inflections
- Sequel::Informix
- Sequel::Informix::Database
- Sequel::Informix::DatabaseMethods
- Sequel::Informix::Dataset
- Sequel::Informix::DatasetMethods
- Sequel::IntegerMigrator
- Sequel::InvalidOperation
- Sequel::InvalidOperation
- Sequel::InvalidValue
- Sequel::InvalidValue
- Sequel::JDBC
- Sequel::JDBC::AS400
- Sequel::JDBC::AS400::DatabaseMethods
- Sequel::JDBC::AS400::Dataset
- Sequel::JDBC::DB2
- Sequel::JDBC::DB2::DatabaseMethods
- Sequel::JDBC::DB2::Dataset
- Sequel::JDBC::Database
- Sequel::JDBC::Derby
- Sequel::JDBC::Derby::DatabaseMethods
- Sequel::JDBC::Derby::Dataset
- Sequel::JDBC::Firebird
- Sequel::JDBC::Firebird::DatabaseMethods
- Sequel::JDBC::Firebird::Dataset
- Sequel::JDBC::H2
- Sequel::JDBC::H2::DatabaseMethods
- Sequel::JDBC::H2::Dataset
- Sequel::JDBC::HSQLDB
- Sequel::JDBC::HSQLDB::DatabaseMethods
- Sequel::JDBC::HSQLDB::Dataset
- Sequel::JDBC::Informix
- Sequel::JDBC::Informix::DatabaseMethods
- Sequel::JDBC::Informix::Dataset
- Sequel::JDBC::JTDS
- Sequel::JDBC::JTDS::DatabaseMethods
- Sequel::JDBC::JTDS::Dataset
- Sequel::JDBC::JavaLang
- Sequel::JDBC::JavaSQL
- Sequel::JDBC::JavaxNaming
- Sequel::JDBC::MSSQL
- Sequel::JDBC::MSSQL::DatabaseMethods
- Sequel::JDBC::MySQL
- Sequel::JDBC::MySQL::DatabaseMethods
- Sequel::JDBC::MySQL::Dataset
- Sequel::JDBC::Oracle
- Sequel::JDBC::Oracle::DatabaseMethods
- Sequel::JDBC::Oracle::Dataset
- Sequel::JDBC::Postgres
- Sequel::JDBC::Postgres::AdapterMethods
- Sequel::JDBC::Postgres::DatabaseMethods
- Sequel::JDBC::Postgres::Dataset
- Sequel::JDBC::SQLServer
- Sequel::JDBC::SQLServer::DatabaseMethods
- Sequel::JDBC::SQLServer::DatabaseMethods::MetadataDatasetMethods
- Sequel::JDBC::SQLServer::Dataset
- Sequel::JDBC::SQLite
- Sequel::JDBC::SQLite::DatabaseMethods
- Sequel::JDBC::SQLite::Dataset
- Sequel::JDBC::Transactions
- Sequel::LiteralString
- Sequel::LooserTypecasting
- Sequel::MSSQL
- Sequel::MSSQL::DatabaseMethods
- Sequel::MSSQL::DatasetMethods
- Sequel::Metaprogramming
- Sequel::Migration
- Sequel::MigrationAlterTableReverser
- Sequel::MigrationDSL
- Sequel::MigrationReverser
- Sequel::Migrator
- Sequel::Migrator::Error
- Sequel::Mock
- Sequel::Mock::Connection
- Sequel::Mock::Database
- Sequel::Mock::Dataset
- Sequel::Model
- Sequel::Model::Associations
- Sequel::Model::Associations::AssociationDatasetMethods
- Sequel::Model::Associations::AssociationReflection
- Sequel::Model::Associations::ClassMethods
- Sequel::Model::Associations::DatasetMethods
- Sequel::Model::Associations::EagerGraphLoader
- Sequel::Model::Associations::InstanceMethods
- Sequel::Model::Associations::ManyToManyAssociationReflection
- Sequel::Model::Associations::ManyToOneAssociationReflection
- Sequel::Model::Associations::OneToManyAssociationReflection
- Sequel::Model::Associations::OneToOneAssociationReflection
- Sequel::Model::ClassMethods
- Sequel::Model::DatasetMethods
- Sequel::Model::Errors
- Sequel::Model::InstanceMethods
- Sequel::MySQL
- Sequel::MySQL::DatabaseMethods
- Sequel::MySQL::DatasetMethods
- Sequel::MySQL::DatasetMethods::CallableStatementMethods
- Sequel::MySQL::DatasetMethods::PreparedStatementMethods
- Sequel::MySQL::DatasetMethods::StoredProcedureMethods
- Sequel::MySQL::PreparedStatements
- Sequel::MySQL::PreparedStatements::DatabaseMethods
- Sequel::Mysql2
- Sequel::Mysql2::Database
- Sequel::Mysql2::Dataset
- Sequel::NamedTimezones
- Sequel::NoExistingObject
- Sequel::NoExistingObject
- Sequel::NotImplemented
- Sequel::ODBC
- Sequel::ODBC::DB2
- Sequel::ODBC::DB2::DatabaseMethods
- Sequel::ODBC::DB2::Dataset
- Sequel::ODBC::Database
- Sequel::ODBC::Dataset
- Sequel::ODBC::MSSQL
- Sequel::ODBC::MSSQL::DatabaseMethods
- Sequel::ODBC::MSSQL::Dataset
- Sequel::OpenBase
- Sequel::OpenBase::Database
- Sequel::OpenBase::Dataset
- Sequel::Oracle
- Sequel::Oracle::Database
- Sequel::Oracle::DatabaseMethods
- Sequel::Oracle::DatasetMethods
- Sequel::Plugins
- Sequel::Plugins::ActiveModel
- Sequel::Plugins::ActiveModel::ClassMethods
- Sequel::Plugins::ActiveModel::InstanceMethods
- Sequel::Plugins::AssociationAutoreloading
- Sequel::Plugins::AssociationAutoreloading::ClassMethods
- Sequel::Plugins::AssociationDependencies
- Sequel::Plugins::AssociationDependencies::ClassMethods
- Sequel::Plugins::AssociationDependencies::InstanceMethods
- Sequel::Plugins::AssociationPks
- Sequel::Plugins::AssociationPks::ClassMethods
- Sequel::Plugins::AssociationPks::InstanceMethods
- Sequel::Plugins::AssociationProxies
- Sequel::Plugins::AssociationProxies::AssociationProxy
- Sequel::Plugins::AssociationProxies::ClassMethods
- Sequel::Plugins::BooleanReaders
- Sequel::Plugins::BooleanReaders::ClassMethods
- Sequel::Plugins::Caching
- Sequel::Plugins::Caching::ClassMethods
- Sequel::Plugins::Caching::InstanceMethods
- Sequel::Plugins::ClassTableInheritance
- Sequel::Plugins::ClassTableInheritance::ClassMethods
- Sequel::Plugins::ClassTableInheritance::InstanceMethods
- Sequel::Plugins::Composition
- Sequel::Plugins::Composition::ClassMethods
- Sequel::Plugins::Composition::InstanceMethods
- Sequel::Plugins::DatasetAssociations
- Sequel::Plugins::DatasetAssociations::ClassMethods
- Sequel::Plugins::DatasetAssociations::DatasetMethods
- Sequel::Plugins::DefaultsSetter
- Sequel::Plugins::DefaultsSetter::ClassMethods
- Sequel::Plugins::DefaultsSetter::InstanceMethods
- Sequel::Plugins::ForceEncoding
- Sequel::Plugins::ForceEncoding::ClassMethods
- Sequel::Plugins::ForceEncoding::InstanceMethods
- Sequel::Plugins::HookClassMethods
- Sequel::Plugins::HookClassMethods::ClassMethods
- Sequel::Plugins::HookClassMethods::InstanceMethods
- Sequel::Plugins::IdentityMap
- Sequel::Plugins::IdentityMap::ClassMethods
- Sequel::Plugins::IdentityMap::InstanceMethods
- Sequel::Plugins::InstanceFilters
- Sequel::Plugins::InstanceFilters::InstanceMethods
- Sequel::Plugins::InstanceHooks
- Sequel::Plugins::InstanceHooks::InstanceMethods
- Sequel::Plugins::JsonSerializer
- Sequel::Plugins::JsonSerializer::ClassMethods
- Sequel::Plugins::JsonSerializer::DatasetMethods
- Sequel::Plugins::JsonSerializer::InstanceMethods
- Sequel::Plugins::JsonSerializer::Literal
- Sequel::Plugins::LazyAttributes
- Sequel::Plugins::LazyAttributes::ClassMethods
- Sequel::Plugins::LazyAttributes::InstanceMethods
- Sequel::Plugins::List
- Sequel::Plugins::List::ClassMethods
- Sequel::Plugins::List::InstanceMethods
- Sequel::Plugins::ManyThroughMany
- Sequel::Plugins::ManyThroughMany::ClassMethods
- Sequel::Plugins::ManyThroughMany::DatasetMethods
- Sequel::Plugins::ManyThroughMany::ManyThroughManyAssociationReflection
- Sequel::Plugins::NestedAttributes
- Sequel::Plugins::NestedAttributes::ClassMethods
- Sequel::Plugins::NestedAttributes::InstanceMethods
- Sequel::Plugins::OptimisticLocking
- Sequel::Plugins::OptimisticLocking::ClassMethods
- Sequel::Plugins::OptimisticLocking::InstanceMethods
- Sequel::Plugins::PreparedStatements
- Sequel::Plugins::PreparedStatements::ClassMethods
- Sequel::Plugins::PreparedStatements::InstanceMethods
- Sequel::Plugins::PreparedStatementsAssociations
- Sequel::Plugins::PreparedStatementsAssociations::ClassMethods
- Sequel::Plugins::PreparedStatementsAssociations::InstanceMethods
- Sequel::Plugins::PreparedStatementsSafe
- Sequel::Plugins::PreparedStatementsSafe::ClassMethods
- Sequel::Plugins::PreparedStatementsSafe::InstanceMethods
- Sequel::Plugins::PreparedStatementsWithPk
- Sequel::Plugins::PreparedStatementsWithPk::ClassMethods
- Sequel::Plugins::PreparedStatementsWithPk::DatasetMethods
- Sequel::Plugins::RcteTree
- Sequel::Plugins::Schema
- Sequel::Plugins::Schema::ClassMethods
- Sequel::Plugins::Serialization
- Sequel::Plugins::Serialization::ClassMethods
- Sequel::Plugins::Serialization::InstanceMethods
- Sequel::Plugins::SerializationModificationDetection
- Sequel::Plugins::SerializationModificationDetection::InstanceMethods
- Sequel::Plugins::Sharding
- Sequel::Plugins::Sharding::ClassMethods
- Sequel::Plugins::Sharding::DatasetMethods
- Sequel::Plugins::Sharding::InstanceMethods
- Sequel::Plugins::SingleTableInheritance
- Sequel::Plugins::SingleTableInheritance::ClassMethods
- Sequel::Plugins::SingleTableInheritance::InstanceMethods
- Sequel::Plugins::SkipCreateRefresh
- Sequel::Plugins::SkipCreateRefresh::InstanceMethods
- Sequel::Plugins::StringStripper
- Sequel::Plugins::StringStripper::InstanceMethods
- Sequel::Plugins::Subclasses
- Sequel::Plugins::Subclasses::ClassMethods
- Sequel::Plugins::TacticalEagerLoading
- Sequel::Plugins::TacticalEagerLoading::DatasetMethods
- Sequel::Plugins::TacticalEagerLoading::InstanceMethods
- Sequel::Plugins::Timestamps
- Sequel::Plugins::Timestamps::ClassMethods
- Sequel::Plugins::Timestamps::InstanceMethods
- Sequel::Plugins::Touch
- Sequel::Plugins::Touch::ClassMethods
- Sequel::Plugins::Touch::InstanceMethods
- Sequel::Plugins::Tree
- Sequel::Plugins::Tree::ClassMethods
- Sequel::Plugins::Tree::InstanceMethods
- Sequel::Plugins::Tree::SingleRoot
- Sequel::Plugins::Tree::SingleRoot::ClassMethods
- Sequel::Plugins::Tree::SingleRoot::InstanceMethods
- Sequel::Plugins::Tree::TreeMultipleRootError
- Sequel::Plugins::TypecastOnLoad
- Sequel::Plugins::TypecastOnLoad::ClassMethods
- Sequel::Plugins::TypecastOnLoad::InstanceMethods
- Sequel::Plugins::UpdatePrimaryKey
- Sequel::Plugins::UpdatePrimaryKey::ClassMethods
- Sequel::Plugins::UpdatePrimaryKey::InstanceMethods
- Sequel::Plugins::ValidationClassMethods
- Sequel::Plugins::ValidationClassMethods::ClassMethods
- Sequel::Plugins::ValidationClassMethods::ClassMethods::Generator
- Sequel::Plugins::ValidationClassMethods::InstanceMethods
- Sequel::Plugins::ValidationHelpers
- Sequel::Plugins::ValidationHelpers::InstanceMethods
- Sequel::Plugins::XmlSerializer
- Sequel::Plugins::XmlSerializer::ClassMethods
- Sequel::Plugins::XmlSerializer::DatasetMethods
- Sequel::Plugins::XmlSerializer::InstanceMethods
- Sequel::PoolTimeout
- Sequel::PoolTimeout
- Sequel::Postgres
- Sequel::Postgres::AdapterMethods
- Sequel::Postgres::DatabaseMethods
- Sequel::Postgres::DatasetMethods
- Sequel::Postgres::DatasetMethods::PreparedStatementMethods
- Sequel::PrettyTable
- Sequel::Progress
- Sequel::Progress::DatabaseMethods
- Sequel::Progress::DatasetMethods
- Sequel::Qualifier
- Sequel::Rollback
- Sequel::Rollback
- Sequel::SQL
- Sequel::SQL::AliasMethods
- Sequel::SQL::AliasedExpression
- Sequel::SQL::BitwiseMethods
- Sequel::SQL::Blob
- Sequel::SQL::BooleanConstant
- Sequel::SQL::BooleanExpression
- Sequel::SQL::BooleanMethods
- Sequel::SQL::CaseExpression
- Sequel::SQL::Cast
- Sequel::SQL::CastMethods
- Sequel::SQL::ColumnAll
- Sequel::SQL::ComplexExpression
- Sequel::SQL::ComplexExpressionMethods
- Sequel::SQL::Constant
- Sequel::SQL::Constants
- Sequel::SQL::Expression
- Sequel::SQL::Function
- Sequel::SQL::GenericComplexExpression
- Sequel::SQL::GenericExpression
- Sequel::SQL::Identifier
- Sequel::SQL::IdentifierMethods
- Sequel::SQL::InequalityMethods
- Sequel::SQL::JoinClause
- Sequel::SQL::JoinOnClause
- Sequel::SQL::JoinUsingClause
- Sequel::SQL::NegativeBooleanConstant
- Sequel::SQL::NoBooleanInputMethods
- Sequel::SQL::NumericExpression
- Sequel::SQL::NumericMethods
- Sequel::SQL::OrderMethods
- Sequel::SQL::OrderedExpression
- Sequel::SQL::PlaceholderLiteralString
- Sequel::SQL::QualifiedIdentifier
- Sequel::SQL::QualifyingMethods
- Sequel::SQL::StringConcatenationMethods
- Sequel::SQL::StringExpression
- Sequel::SQL::StringMethods
- Sequel::SQL::Subscript
- Sequel::SQL::SubscriptMethods
- Sequel::SQL::ValueList
- Sequel::SQL::ValueList
- Sequel::SQL::VirtualRow
- Sequel::SQL::Window
- Sequel::SQL::WindowFunction
- Sequel::SQLTime
- Sequel::SQLite
- Sequel::SQLite::DatabaseMethods
- Sequel::SQLite::DatasetMethods
- Sequel::Schema
- Sequel::Schema::AlterTableGenerator
- Sequel::Schema::Generator
- Sequel::ServerBlock
- Sequel::ShardedSingleConnectionPool
- Sequel::ShardedThreadedConnectionPool
- Sequel::SimpleMigration
- Sequel::SingleConnectionPool
- Sequel::Swift
- Sequel::Swift::Database
- Sequel::Swift::Dataset
- Sequel::Swift::MySQL
- Sequel::Swift::MySQL::DatabaseMethods
- Sequel::Swift::MySQL::Dataset
- Sequel::Swift::Postgres
- Sequel::Swift::Postgres::AdapterMethods
- Sequel::Swift::Postgres::DatabaseMethods
- Sequel::Swift::Postgres::Dataset
- Sequel::Swift::SQLite
- Sequel::Swift::SQLite::DatabaseMethods
- Sequel::Swift::SQLite::Dataset
- Sequel::ThreadLocalTimezones
- Sequel::ThreadedConnectionPool
- Sequel::ThreadedServerBlock
- Sequel::TimestampMigrator
- Sequel::Timezones
- Sequel::TinyTDS
- Sequel::TinyTDS::Database
- Sequel::TinyTDS::Dataset
- Sequel::TinyTDS::Dataset::ArgumentMapper
- Sequel::TinyTDS::Dataset::PreparedStatementMethods
- Sequel::ToDot
- Sequel::UnbindDuplicate
- Sequel::Unbinder
- Sequel::UndefinedAssociation
- Sequel::UnthreadedServerBlock
- Sequel::ValidationFailed
- Dataset
- Dataset::ArgumentMapper
- Dataset::BindArgumentMethods
- Dataset::PreparedStatementMethods
- String
- String::Inflections
- Array
- FalseClass
- Hash
- NilClass
- Numeric
- Object
- PGconn
- PGresult
- Proc
- Symbol
- TrueClass

No matching classes.

# Sequel::MSSQL::DatasetMethods

### Constants

BOOL_TRUE
BOOL_FALSE
COMMA_SEPARATOR
DELETE_CLAUSE_METHODS
INSERT_CLAUSE_METHODS
SELECT_CLAUSE_METHODS
UPDATE_CLAUSE_METHODS
NOLOCK
UPDLOCK
WILDCARD
CONSTANT_MAP
EXTRACT_MAP
BRACKET_CLOSE
BRACKET_OPEN
COMMA
PAREN_CLOSE
PAREN_SPACE_OPEN
SPACE
FROM
APOS
APOS_RE
DOUBLE_APOS
INTO
DATEPART_SECOND_OPEN
DATEPART_SECOND_MIDDLE
DATEPART_SECOND_CLOSE
DATEPART_OPEN
UNION_ALL
SELECT_SPACE
TIMESTAMP_USEC_FORMAT
OUTPUT_INSERTED
HEX_START
UNICODE_STRING_START
TOP_PAREN
TOP
OUTPUT
HSTAR
CASE_SENSITIVE_COLLATION
CASE_INSENSITIVE_COLLATION

### Attributes

mssql_unicode_strings[RW]

Allow overriding of the mssql_unicode_strings option at the dataset level.

### Public Class Methods

new(db, opts={}) click to toggle source

Copy the mssql_unicode_strings option from the `db` object.

         # File lib/sequel/adapters/shared/mssql.rb, line 339
    339:       def initialize(db, opts={})
    340:         super
    341:         @mssql_unicode_strings = db.mssql_unicode_strings
    342:       end

### Public Instance Methods

complex_expression_sql_append(sql, op, args) click to toggle source

MSSQL uses + for string concatenation, and LIKE is case insensitive by default.

         # File lib/sequel/adapters/shared/mssql.rb, line 345
    345:       def complex_expression_sql_append(sql, op, args)
    346:         case op
    347:         when :'||'
    348:           super(sql, :+, args)
    349:         when :LIKE, :"NOT LIKE"
    350:           super(sql, op, args.map{|a| LiteralString.new("(#{literal(a)} COLLATE #{CASE_SENSITIVE_COLLATION})")})
    351:         when :ILIKE, :"NOT ILIKE"
    352:           super(sql, (op == :ILIKE ? :LIKE : :"NOT LIKE"), args.map{|a| LiteralString.new("(#{literal(a)} COLLATE #{CASE_INSENSITIVE_COLLATION})")})
    353:         when :<<
    354:           sql << complex_expression_arg_pairs(args){|a, b| "(#{literal(a)} * POWER(2, #{literal(b)}))"}
    355:         when :>>
    356:           sql << complex_expression_arg_pairs(args){|a, b| "(#{literal(a)} / POWER(2, #{literal(b)}))"}
    357:         when :extract
    358:           part = args.at(0)
    359:           raise(Sequel::Error, "unsupported extract argument: #{part.inspect}") unless format = EXTRACT_MAP[part]
    360:           if part == :second
    361:             expr = literal(args.at(1))
    362:             sql << DATEPART_SECOND_OPEN << format.to_s << COMMA << expr << DATEPART_SECOND_MIDDLE << expr << DATEPART_SECOND_CLOSE
    363:           else
    364:             sql << DATEPART_OPEN << format.to_s << COMMA
    365:             literal_append(sql, args.at(1))
    366:             sql << PAREN_CLOSE
    367:           end
    368:         else
    369:           super
    370:         end
    371:       end

constant_sql_append(sql, constant) click to toggle source

MSSQL doesn’t support the SQL standard CURRENT_DATE or CURRENT_TIME

         # File lib/sequel/adapters/shared/mssql.rb, line 374
    374:       def constant_sql_append(sql, constant)
    375:         if c = CONSTANT_MAP[constant]
    376:           sql << c
    377:         else
    378:           super
    379:         end
    380:       end

disable_insert_output() click to toggle source

Disable the use of INSERT OUTPUT

         # File lib/sequel/adapters/shared/mssql.rb, line 383
    383:       def disable_insert_output
    384:         clone(:disable_insert_output=>true)
    385:       end

disable_insert_output!() click to toggle source

Disable the use of INSERT OUTPUT, modifying the receiver

         # File lib/sequel/adapters/shared/mssql.rb, line 388
    388:       def disable_insert_output!
    389:         mutation_method(:disable_insert_output)
    390:       end

full_text_search(cols, terms, opts = {}) click to toggle source

MSSQL uses the CONTAINS keyword for full text search

         # File lib/sequel/adapters/shared/mssql.rb, line 393
    393:       def full_text_search(cols, terms, opts = {})
    394:         terms = "\"#{terms.join('" OR "')}\"" if terms.is_a?(Array)
    395:         filter("CONTAINS (?, ?)", cols, terms)
    396:       end

insert_select(*values) click to toggle source

Use the OUTPUT clause to get the value of all columns for the newly inserted record.

         # File lib/sequel/adapters/shared/mssql.rb, line 399
    399:       def insert_select(*values)
    400:         return unless supports_insert_select?
    401:         naked.clone(default_server_opts(:sql=>output(nil, [SQL::ColumnAll.new(:inserted)]).insert_sql(*values))).single_record
    402:       end

into(table) click to toggle source

Specify a table for a SELECT … INTO query.

         # File lib/sequel/adapters/shared/mssql.rb, line 405
    405:       def into(table)
    406:         clone(:into => table)
    407:       end

multi_insert_sql(columns, values) click to toggle source

MSSQL uses a UNION ALL statement to insert multiple values at once.

         # File lib/sequel/adapters/shared/mssql.rb, line 410
    410:       def multi_insert_sql(columns, values)
    411:         c = false
    412:         sql = LiteralString.new('')
    413:         u = UNION_ALL
    414:         values.each do |v|
    415:           sql << u if c
    416:           sql << SELECT_SPACE
    417:           expression_list_append(sql, v)
    418:           c ||= true
    419:         end
    420:         [insert_sql(columns, sql)]
    421:       end

nolock() click to toggle source

Allows you to do a dirty read of uncommitted data using WITH (NOLOCK).

         # File lib/sequel/adapters/shared/mssql.rb, line 424
    424:       def nolock
    425:         lock_style(:dirty)
    426:       end

output(into, values) click to toggle source

Include an OUTPUT clause in the eventual INSERT, UPDATE, or DELETE query.

The first argument is the table to output into, and the second argument is either an Array of column values to select, or a Hash which maps output column names to selected values, in the style of # or #.

Output into a returned result set is not currently supported.

Examples:

      dataset.output(:output_table, [:deleted__id, :deleted__name])
      dataset.output(:output_table, :id => :inserted__id, :name => :inserted__name)

         # File lib/sequel/adapters/shared/mssql.rb, line 440
    440:       def output(into, values)
    441:         raise(Error, "SQL Server versions 2000 and earlier do not support the OUTPUT clause") unless supports_output_clause?
    442:         output = {}
    443:         case values
    444:           when Hash
    445:             output[:column_list], output[:select_list] = values.keys, values.values
    446:           when Array
    447:             output[:select_list] = values
    448:         end
    449:         output[:into] = into
    450:         clone({:output => output})
    451:       end

output!(into, values) click to toggle source

An output method that modifies the receiver.

         # File lib/sequel/adapters/shared/mssql.rb, line 454
    454:       def output!(into, values)
    455:         mutation_method(:output, into, values)
    456:       end

quoted_identifier_append(sql, name) click to toggle source

MSSQL uses [] to quote identifiers

         # File lib/sequel/adapters/shared/mssql.rb, line 459
    459:       def quoted_identifier_append(sql, name)
    460:         sql << BRACKET_OPEN << name.to_s << BRACKET_CLOSE
    461:       end

server_version() click to toggle source

The version of the database server.

         # File lib/sequel/adapters/shared/mssql.rb, line 464
    464:       def server_version
    465:         db.server_version(@opts[:server])
    466:       end

supports_group_cube?() click to toggle source

MSSQL 2005+ supports GROUP BY CUBE.

         # File lib/sequel/adapters/shared/mssql.rb, line 469
    469:       def supports_group_cube?
    470:         is_2005_or_later?
    471:       end

supports_group_rollup?() click to toggle source

MSSQL 2005+ supports GROUP BY ROLLUP

         # File lib/sequel/adapters/shared/mssql.rb, line 474
    474:       def supports_group_rollup?
    475:         is_2005_or_later?
    476:       end

supports_insert_select?() click to toggle source

MSSQL supports insert_select via the OUTPUT clause.

         # File lib/sequel/adapters/shared/mssql.rb, line 479
    479:       def supports_insert_select?
    480:         supports_output_clause? && !opts[:disable_insert_output]
    481:       end

supports_intersect_except?() click to toggle source

MSSQL 2005+ supports INTERSECT and EXCEPT

         # File lib/sequel/adapters/shared/mssql.rb, line 484
    484:       def supports_intersect_except?
    485:         is_2005_or_later?
    486:       end

supports_is_true?() click to toggle source

MSSQL does not support IS TRUE

         # File lib/sequel/adapters/shared/mssql.rb, line 489
    489:       def supports_is_true?
    490:         false
    491:       end

supports_join_using?() click to toggle source

MSSQL doesn’t support JOIN USING

         # File lib/sequel/adapters/shared/mssql.rb, line 494
    494:       def supports_join_using?
    495:         false
    496:       end

supports_modifying_joins?() click to toggle source

MSSQL 2005+ supports modifying joined datasets

         # File lib/sequel/adapters/shared/mssql.rb, line 499
    499:       def supports_modifying_joins?
    500:         is_2005_or_later?
    501:       end

supports_multiple_column_in?() click to toggle source

MSSQL does not support multiple columns for the IN/NOT IN operators

         # File lib/sequel/adapters/shared/mssql.rb, line 504
    504:       def supports_multiple_column_in?
    505:         false
    506:       end

supports_output_clause?() click to toggle source

MSSQL 2005+ supports the output clause.

         # File lib/sequel/adapters/shared/mssql.rb, line 509
    509:       def supports_output_clause?
    510:         is_2005_or_later?
    511:       end

supports_where_true?() click to toggle source

MSSQL cannot use WHERE 1.

         # File lib/sequel/adapters/shared/mssql.rb, line 519
    519:       def supports_where_true?
    520:         false
    521:       end

supports_window_functions?() click to toggle source

MSSQL 2005+ supports window functions

         # File lib/sequel/adapters/shared/mssql.rb, line 514
    514:       def supports_window_functions?
    515:         true
    516:       end

### Protected Instance Methods

_import(columns, values, opts={}) click to toggle source

If returned primary keys are requested, use OUTPUT unless already set on the dataset. If OUTPUT is already set, use existing returning values. If OUTPUT is only set to return a single columns, return an array of just that column. Otherwise, return an array of hashes.

         # File lib/sequel/adapters/shared/mssql.rb, line 529
    529:       def _import(columns, values, opts={})
    530:         if opts[:return] == :primary_key && !@opts[:output]
    531:           output(nil, [SQL::QualifiedIdentifier.new(:inserted, first_primary_key)])._import(columns, values, opts)
    532:         elsif @opts[:output]
    533:           statements = multi_insert_sql(columns, values)
    534:           @db.transaction(opts.merge(:server=>@opts[:server])) do
    535:             statements.map{|st| with_sql(st)}
    536:           end.first.map{|v| v.length == 1 ? v.values.first : v}
    537:         else
    538:           super
    539:         end
    540:       end

aggregate_dataset() click to toggle source

MSSQL does not allow ordering in sub-clauses unless ‘top’ (limit) is specified

         # File lib/sequel/adapters/shared/mssql.rb, line 543
    543:       def aggregate_dataset
    544:         (options_overlap(Sequel::Dataset::COUNT_FROM_SELF_OPTS) && !options_overlap([:limit])) ? unordered.from_self : super
    545:       end

### Private Instance Methods

delete_clause_methods() click to toggle source

MSSQL supports the OUTPUT clause for DELETE statements. It also allows prepending a WITH clause.

         # File lib/sequel/adapters/shared/mssql.rb, line 555
    555:       def delete_clause_methods
    556:         DELETE_CLAUSE_METHODS
    557:       end

delete_from2_sql(sql) click to toggle source

MSSQL supports FROM clauses in DELETE and UPDATE statements.

         # File lib/sequel/adapters/shared/mssql.rb, line 566
    566:       def delete_from2_sql(sql)
    567:         if joined_dataset?
    568:           select_from_sql(sql)
    569:           select_join_sql(sql)
    570:         end
    571:       end

Also aliased as: update_from_sql
delete_from_sql(sql) click to toggle source

Only include the primary table in the main delete clause

         # File lib/sequel/adapters/shared/mssql.rb, line 560
    560:       def delete_from_sql(sql)
    561:         sql << FROM
    562:         source_list_append(sql, @opts[:from][0..0])
    563:       end

delete_output_sql(sql) click to toggle source
Alias for: output_sql
first_primary_key() click to toggle source

Return the first primary key for the current table. If this table has multiple primary keys, this will only return one of them. Used by #_import.

         # File lib/sequel/adapters/shared/mssql.rb, line 576
    576:       def first_primary_key
    577:         @db.schema(self).map{|k, v| k if v[:primary_key] == true}.compact.first
    578:       end

format_timestamp_usec(usec) click to toggle source

MSSQL raises an error if you try to provide more than 3 decimal places for a fractional timestamp. This probably doesn’t work for smalldatetime fields.

         # File lib/sequel/adapters/shared/mssql.rb, line 583
    583:       def format_timestamp_usec(usec)
    584:         sprintf(TIMESTAMP_USEC_FORMAT, usec/1000)
    585:       end

insert_clause_methods() click to toggle source

MSSQL supports the OUTPUT clause for INSERT statements. It also allows prepending a WITH clause.

         # File lib/sequel/adapters/shared/mssql.rb, line 589
    589:       def insert_clause_methods
    590:         INSERT_CLAUSE_METHODS
    591:       end

insert_output_sql(sql) click to toggle source

Use OUTPUT INSERTED.* to return all columns of the inserted row, for use with the prepared statement code.

         # File lib/sequel/adapters/shared/mssql.rb, line 595
    595:       def insert_output_sql(sql)
    596:         if @opts.has_key?(:returning)
    597:           sql << OUTPUT_INSERTED
    598:         else
    599:           output_sql(sql)
    600:         end
    601:       end

is_2005_or_later?() click to toggle source

         # File lib/sequel/adapters/shared/mssql.rb, line 549
    549:       def is_2005_or_later?
    550:         server_version >= 9000000
    551:       end

literal_blob_append(sql, v) click to toggle source

MSSQL uses a literal hexidecimal number for blob strings

         # File lib/sequel/adapters/shared/mssql.rb, line 604
    604:       def literal_blob_append(sql, v)
    605:         sql << HEX_START << v.unpack(HSTAR).first
    606:       end

literal_false() click to toggle source

Use 0 for false on MSSQL

         # File lib/sequel/adapters/shared/mssql.rb, line 616
    616:       def literal_false
    617:         BOOL_FALSE
    618:       end

literal_string_append(sql, v) click to toggle source

Optionally use unicode string syntax for all strings. Don’t double backslashes.

         # File lib/sequel/adapters/shared/mssql.rb, line 610
    610:       def literal_string_append(sql, v)
    611:         sql << (mssql_unicode_strings ? UNICODE_STRING_START : APOS)
    612:         sql << v.gsub(APOS_RE, DOUBLE_APOS) << APOS
    613:       end

literal_true() click to toggle source

Use 1 for true on MSSQL

         # File lib/sequel/adapters/shared/mssql.rb, line 621
    621:       def literal_true
    622:         BOOL_TRUE
    623:       end

output_sql(sql) click to toggle source

SQL fragment for MSSQL’s OUTPUT clause.

         # File lib/sequel/adapters/shared/mssql.rb, line 665
    665:       def output_sql(sql)
    666:         return unless supports_output_clause?
    667:         return unless output = @opts[:output]
    668:         sql << OUTPUT
    669:         column_list_append(sql, output[:select_list])
    670:         if into = output[:into]
    671:           sql << INTO
    672:           table_ref_append(sql, into)
    673:           if column_list = output[:column_list]
    674:             sql << PAREN_SPACE_OPEN
    675:             source_list_append(sql, column_list)
    676:             sql << PAREN_CLOSE
    677:           end
    678:         end
    679:       end

Also aliased as: delete_output_sql, update_output_sql
select_clause_methods() click to toggle source

MSSQL adds the limit before the columns

         # File lib/sequel/adapters/shared/mssql.rb, line 626
    626:       def select_clause_methods
    627:         SELECT_CLAUSE_METHODS
    628:       end

select_into_sql(sql) click to toggle source

         # File lib/sequel/adapters/shared/mssql.rb, line 630
    630:       def select_into_sql(sql)
    631:         if i = @opts[:into]
    632:           sql << INTO
    633:           table_ref_append(sql, i)
    634:         end
    635:       end

select_limit_sql(sql) click to toggle source

MSSQL uses TOP N for limit. For MSSQL 2005+ TOP (N) is used to allow the limit to be a bound variable.

         # File lib/sequel/adapters/shared/mssql.rb, line 639
    639:       def select_limit_sql(sql)
    640:         if l = @opts[:limit]
    641:           if is_2005_or_later?
    642:             sql << TOP_PAREN
    643:             literal_append(sql, l)
    644:             sql << PAREN_CLOSE
    645:           else
    646:             sql << TOP
    647:             literal_append(sql, l)
    648:           end
    649:         end
    650:       end

select_lock_sql(sql) click to toggle source

Support different types of locking styles

         # File lib/sequel/adapters/shared/mssql.rb, line 653
    653:       def select_lock_sql(sql)
    654:         case @opts[:lock]
    655:         when :update
    656:           sql << UPDLOCK
    657:         when :dirty
    658:           sql << NOLOCK
    659:         else
    660:           super
    661:         end
    662:       end

update_clause_methods() click to toggle source

MSSQL supports the OUTPUT clause for UPDATE statements. It also allows prepending a WITH clause.

         # File lib/sequel/adapters/shared/mssql.rb, line 685
    685:       def update_clause_methods
    686:         UPDATE_CLAUSE_METHODS
    687:       end

update_from_sql(sql) click to toggle source
Alias for: delete_from2_sql
update_output_sql(sql) click to toggle source
Alias for: output_sql
update_table_sql(sql) click to toggle source

Only include the primary table in the main update clause

         # File lib/sequel/adapters/shared/mssql.rb, line 690
    690:       def update_table_sql(sql)
    691:         sql << SPACE
    692:         source_list_append(sql, @opts[:from][0..0])
    693:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.