Fix an issue with limits and offset in sqlserver.