Yup that fixed it, no TDS errors here. 
DB[:table].group_and_count(:column).group_rollup generated: SELECT 
[column], count(*) AS [COUNT] FROM [table] GROUP BY [column] WITH ROLLUP. 
On a slightly unrelated note, we use SQL Server 2005 exclusively and I 
would like to run the test suite from time to time and possibly apply fixes 
if needed. Do I need to do anything special to run the specs against a 
database or will rake spec just automagically work? :)

Thanks,

Doug

On Friday, March 16, 2012 4:18:48 PM UTC-4, Jeremy Evans wrote:
>
> On Friday, March 16, 2012 12:23:18 PM UTC-7, Jeremy Evans wrote:
>>
>> On Friday, March 16, 2012 11:57:38 AM UTC-7, Doug Tykocki wrote:
>>>
>>> I ran the same bit of code against SQL Server 2005 and got 
>>> a Sequel::DatabaseError: TinyTds::Error: 'ROLLUP' is not a recognized 
>>> built-in function name.
>>>
>>
>> Ah, looks like SQL Server 2005 supports WITH ROLLUP and SQL Server 2008 
>> supports ROLLUP(), though 2008 also supports WITH ROLLUP for backwards 
>> compatibility.  See:
>>
>> 2005: 
>> http://technet.microsoft.com/en-us/library/ms177673%28v=sql.90%29.aspx
>> 2008: http://technet.microsoft.com/en-us/library/ms177673.aspx
>>
>> It says that WITH ROLLUP will be removed in a future version of SQL 
>> Server.  I'll modify Sequel to use WITH ROLLUP/CUBE instead of 
>> ROLLUP()/CUBE() on SQL Server 2005.
>>
>> I only test on SQL Server 2008, which is why I didn't catch this bug.
>>
>
>
> This should fix it: 
> https://github.com/jeremyevans/sequel/commit/5aa75e16c1aae0ed56683505f30f755b0a650cfb
>
> Can any SQL 2005 users confirm?
>
> Thanks,
> Jeremy 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/SeOW5-3p1KQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to