Add OFFSET support for SQL Server 2012
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php
index d2b73ae..e3e97f1 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_driver.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php
@@ -462,6 +462,12 @@
 	 */
 	protected function _limit($sql, $limit, $offset)
 	{
+		// As of SQL Server 2012 (11.0.*) OFFSET is supported
+		if ($offset != 0 && version_compare($this->version(), '11', '>='))
+		{
+			return $sql .= ' OFFSET '. (int) $offset .' ROW FETCH NEXT '. (int) $limit .' ROW ONLY';
+		}
+
 		return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.($limit + $offset).' ', $sql);
 	}