Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This may have been fixed already in the source? I suggest you try the most recent source from <a href="http://github.com/subsonic/SubSonic-2.0" rel="nofollow noreferrer">github</a> to see if the problem has been addressed.</p> <p>Basically, it's as you said -- the 2005 generator overrides the BuildPagedSelectStatement() method provided by ANSISqlGenerator. The 2008 generator inherits from 2005, so it <em>should</em> use the same paging method as 2005.</p> <p>This can be seen by comparing these <a href="http://github.com/subsonic/SubSonic-2.0/blob/master/SubSonic/SqlQuery/SqlGenerators/Sql2008Generator.cs" rel="nofollow noreferrer">two</a> <a href="http://github.com/subsonic/SubSonic-2.0/blob/master/SubSonic/SqlQuery/SqlGenerators/Sql2005Generator.cs" rel="nofollow noreferrer">files</a>:</p> <p>I believe you would also see the behavior you're describing on a SQL 2000 database since it doesn't override the ANSISqlGenerator.BuildPagedSelectStatement() method.</p> <p>Also, <a href="http://github.com/subsonic/SubSonic-2.0/blob/master/SubSonic/Utility.cs" rel="nofollow noreferrer">I don't think compatability level is used</a> to determine the SQL generator:</p> <pre><code> public static bool IsSql2008(DataProvider provider) { return provider.DatabaseVersion.IndexOf("2008 - 10.") &gt; -1 || provider.DatabaseVersion.IndexOf("2008 (RTM) - 10.") &gt; -1; } </code></pre> <p>And, assuming the <a href="http://github.com/subsonic/SubSonic-2.0/blob/master/SubSonic/SqlQuery/SqlGenerators/ANSISqlGenerator.cs" rel="nofollow noreferrer">ANSI generator</a> is what's actually being used, the problem with the AND may be caused by this line in BuildPagedSqlStatement():</p> <pre><code> //have to doctor the wheres, since we're using a WHERE in the paging //bits. So change all "WHERE" to "AND" string tweakedWheres = wheres.Replace("WHERE", "AND"); </code></pre> <p>It needs to be a little smarter than that, although the point you raise about the duplicated clause also needs to be addressed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload