Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
MSSQL Support
  • Hi

    I have a project that will potentially need MSSQL as the database. How is the DB/ORM support for 1.4?
  • HarroHarro
    Accepted Answer
    If you mean: support for MSSQL, the answer is "virtually non-existent".

    It depends a bit on which MSSQL version, the biggest issue with the older versions is the absense of LIMIT and OFFSET which are heavily used by ORM. All other stuff works fine with the PDO driver.

    I wrote a custom driver about a year ago, emulating them using a TOP query, I'm not sure that still works.


  • Is there some sort of tutorial that you can lead me to on how to make MSSQL work using PDO driver?
  • HarroHarro
    Accepted Answer
    Don't think so, as the issue is not driver, but SQL dialect.

    Where most RDBMS systems use (a variant of) ANSI-SQL, MSSQL uses Transact-SQL (originally from Sybase, aquired by MS when they bought the source of Sybase 4, which became the first MSSQL).

    This in itself is not a problem, as you can code your own queries using the query() method, so PDO works fine with MSSQL.

    The problem is if you want to use DBUtil methods, or Model_Crud or ORM. These generate SQL using either their own of existing DB methods, which assume ANSI-SQL is used. Most notably OFFSET and LIMIT, for which MSSQL has no support until the last version. So an MSSQL driver must be able to convert an OFFSET/LIMIT query to a TOP query with a subquery, which is a very complex thing to do.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion