File: mssql_emulate_lateral_with_apply.rb [sequel-4.5.0 Documentation]

Last Modified
  2014-02-26 07:33:22 +0000
Requires

## Description

The mssql_emulate_lateral_with_apply extension converts queries that use LATERAL into queries that use CROSS/OUTER APPLY, allowing code that works on databases that support LATERAL via Dataset#lateral to run on Microsoft SQL Server and Sybase SQLAnywhere.

This is available as a separate extension instead of integrated into the Microsoft SQL Server and Sybase SQLAnywhere support because few people need it and there is a performance hit to code that doesn't use it.

It is possible there are cases where this emulation does not work. Users should probably verify that correct results are returned when using this extension.

You can load this extension into specific datasets:

    ds = DB[:table]
    ds = ds.extension(:mssql_emulate_lateral_with_apply)

Or you can load it into all of a database's datasets:

    DB.extension(:mssql_emulate_lateral_with_apply)