limit & offset workaround for SQL Server, fixes #671

Here a solid and short solution to #671, #670.
Works for both, MS SQL Server 2008 and 2012. 
Works with setting only `limit` and/or only `offset` option.