Is there anyway to hook into the executing of the SQL so that I can
alter the SQL before it is executed?

Or anyway to stop NHibernate from being "smart".

The SQL NHibernate tries to execute as a result of the configuration
(with the formula) is this:
SELECT this_.PriceId as PriceId0_0_,
        this_.Multiplier as Multiplier0_0_,
        this_.EffectiveDate as Effectiv3_0_0_,
        (ROW_NUMBER() this_.OVER (this_.PARTITION BY this_.AgreementId ORDER
BY this_.EffectiveDate DESC)) as formula0_0_
FROM Price this_

I just need to change this to:

SELECT this_.PriceId as PriceId0_0_,
        this_.Multiplier as Multiplier0_0_,
        this_.EffectiveDate as Effectiv3_0_0_,
        (ROW_NUMBER() OVER (PARTITION BY this_.AgreementId ORDER BY
this_.EffectiveDate DESC)) as formula0_0_
FROM Price this_

Please anyone?

On 5 Mar, 19:36, robcar <[email protected]> wrote:
> Thanks guys, my bad!
>
> I did some testing enclosing it in parenthesis and messed up when
> posting.
> Unfortunately this isn't the problem. NHibernate still doesn't
> recognize OVER and PARTITION as reserved words.
>
> I also think I messed up with adding a column alias, so the "correct"
> formula (that stil causes an exception) is:
> ROW_NUMBER() OVER (PARTITION BY AgreementId ORDER BY EffectiveDate
> DESC)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to