none
Unable to connect to SQL Server from PowerQuery - Incorrect Syntax near Max RRS feed

  • Question

  • Anyone have any ideas on this? I have Excel 2016 and when I use the Get & Transform New Query to our SQL server, if I put in the database I want to connect to, I get:

    • Unable to connect
    • We Encountered an error while trying to connect
    • Details: "Microsoft SQL Line 1: Incorrect syntax near 'max'"

    If I exclude the database name and just use the server name, I get:

    • Unable to connect
    • We Encountered an error while trying to connect
    • Details: "Microsoft SQL Line 1: Invalid Object name "sys.databases'

    I can make a connection to the database I want successfully using the MS SQL ODBC driver, so I know the database is there and the SQL Server is responding with data.

    Not sure if there is an advantage of going directly to the SQL server vs going through an ODBC connection. I know using the SQL Server connection will give me related table fields, which could be nice, but not critical.

    Either way, I'd like to resolve.

    Pointers?

    EDIT: further info:

    If I put in either of the following SQL statements it works, so I guess the real issue is I cannot browse tables. Frustrating...

    SELECT GL_Detail.acct
    FROM GL_Detail;

    SELECT *
    FROM GL_Detail;


    Ed


    • Edited by EdHans Wednesday, August 17, 2016 1:27 AM more info
    Wednesday, August 17, 2016 1:23 AM

Answers

  • Which version of SQL Server are you using? We don't support SQL Server 2000 with the richer UI, which is the last version that didn't have "sys.databases".
    • Marked as answer by EdHans Wednesday, August 17, 2016 5:50 PM
    Wednesday, August 17, 2016 3:36 PM

All replies

  • Which version of SQL Server are you using? We don't support SQL Server 2000 with the richer UI, which is the last version that didn't have "sys.databases".
    • Marked as answer by EdHans Wednesday, August 17, 2016 5:50 PM
    Wednesday, August 17, 2016 3:36 PM
  • Which version of SQL Server are you using? We don't support SQL Server 2000 with the richer UI, which is the last version that didn't have "sys.databases".
    Ugh. That is it. We do have SQL 2000. I had looked here but didn't see any SQL Server limits. Thanks for the info.

    Ed

    Wednesday, August 17, 2016 5:50 PM