Home > Forum > Database > SQL statement with "ROW_NUMBER" function working in MSSQL Management Studio but not in Webcon designer.

SQL statement with "ROW_NUMBER" function working in MSSQL Management Studio but not in Webcon designer.
0

Hello folks,

The query in the attached image is not working in the designer, but working flawlessly on the same DB in the MSSQL Management Studio.

Is there the possibility that the designer somehow does not like "ROW_NUMBER" function? Or is it a Webcon bug?

I hope someone has experience with this already.

Thanks in advance :)

MVP

Hi Fabian,

ROW_Number is not allowed, this has also been added to the info tooltip in BPS 2022:
Quote

Because of this mechanism, there are certain limitations to the query syntax, such as:
1. The query should return the data in the following format: SELECT column1, column2, ... FROM table_name
2. It is not possible to call stored procedures inside of the query
3. It is not possible to use the ROW_NUMBER() function
4. The columns must be named (e.g. SELECT column1, CAST(25.65 AS int) AS column2 FROM table_name)
5. When using the ORDER BY clause, it is necessary to use column aliases (e.g. SELECT column1 AS Id, CAST(25.65 AS int) AS column2 FROM table_name ORDER BY Id)
6. It is not possible to use clause WITH query AS (SELECT column1, column2, ...) ...

If you need it, you have to create a view and query this view.

Best regards,
Daniel