Using a SQL Profiler I was able to apprehend that the correct insert is performed, but during _refresh() the following invalid query is sent:
{quote}
SELECT "vp_Email_Requests".* FROM "vp_Email_Requests" WHERE ("TblPK" = 181) SELECT * FROM (SELECT TOP 1 * FROM {color:red} (){color} AS inner_tbl) AS outer_tbl
{quote}
Which is sending an error back "Incorrect syntax near ')'" (highlighted in red)

I'm certain my application code is right, because I've done similar tasks using a MySQL adapter. I'm thinking this is a Mssql adapter related bug.

Comments

Posted by Adam VanBerlo (nix0n) on 2008-04-15T14:58:56.000+0000

This is what $email_requests_table is an instance of

Posted by Wil Sinclair (wil) on 2008-04-18T13:20:28.000+0000

Please evaluate and categorize as necessary.

Posted by Chris Dary (umbrae) on 2008-05-12T12:14:53.000+0000

It looks like this bug may be coming from line 1044 of Zend/Db/Select.php

$this->_adapter->limit('', $count, $offset)

It's calling the limit function, but passing an empty $sql variable, so the result is that the subselect is empty.