SELECT TOP() in SQLSERVER 2000

Posts   
 
    
Posts: 64
Joined: 30-Aug-2010
# Posted on: 14-Apr-2011 10:40:30   

Hello,

I am using LLBLGen Pro 3.0, built from 26.01.2011 with a SqlServer 2000 database.

At some point, when fetching an entity collection, I am getting the following error :

SqlException occured
Line 1: Incorrect syntax near '('.

I retrieved the quey from the log files, and it is a

SELECT TOP(1) FROM ....

This select is not working in SqlServer 2000. In newer versions (2005, 200sunglasses it works fine.

The correct syntax for sqlserver 2000 should be:

SELECT TOP 1 FROM ...

Do you have any tip on how I could overcome this?

Thank you

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Apr-2011 11:09:52   

Do you have the following set under appSettings in your aplication config file?

<add key="SqlServerDQECompatibilityLevel" value="1" />

ref: DQE Compatibility mode

Posts: 64
Joined: 30-Aug-2010
# Posted on: 14-Apr-2011 11:34:09   

Hello,

Thank you for the quick answer.

I have also just found the folowing article where it explains to do the same thing:

http://www.llblgen.com/documentation/3.0/LLBLGen%20Pro%20RTF/hh_start.htm#Using%20the%20generated%20code/gencode_applicationconfiguration.htm#compatibilitymodesqlserver

I added the line in the App.config file, and now it works.