PDO
PDO copied to clipboard
Limit clause with sql server
Can we detect driver and change LIMIT 1 to TOP(1) and place after SELECT?
Might be something to look into for V2. :+1:
I maybe able to contribute one here soon.
Ok, now that 2.x stuff is just about done, I am going to shoot for this around version 3.x. @johnlackey If its still a desire, you can extend v2 to override the __toString() rendering. You will need to extend the database class as well if you want to use it as a factory.
@johnlackey Do you know what the support for TOP limit is in sql server? I seem to remember there being a syntax change in 2012. The old code I was using looked something like OFFSET {$this->offset} ROWS FETCH NEXT {$this->number} ROWS ONLY but I think that was only for 2012 and later.
TOP is supported for 2005 and above
@johnlackey https://github.com/kwhat/PDO-SqlSrv Give this a go. It will only work with what I will be pushing to the 2.1 branch.