odbc_exec() Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint

Viewed 21

I am using PHP and ODBC to access a database with MFA using itneractive authentication Code is below

I get a Connection Successful, but an error on the SQL query

Connection Successful ! Warning: odbc_exec(): SQL error: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cursor support is not an implemented feature for SQL Server Parallel DataWarehousing TDS endpoint., SQL state 37000 in SQLExecDirect in C:\xampp\htdocs\azure.php on line 27 Error in SQL

I can execute this query without issues from SQL Management Studio, so I know it's not a Database issue.

Search online reveals that I need to enable Cursor support in ODBC Searching online how to do this in PHP does not reveal any answers.

If possible, please provide some code to enable cursor support in PHP in ODBC, or help reformat the SQL string to not use cursor support

Thanks.

<?php
    
    $server = 'database.net';
    $database = 'testdatabase';
    $user = 'testuser';
    $password = '';
    
    $connection = odbc_connect("Driver={ODBC Driver 18 for SQL Server};Server=$server;Database=$database;Authentication=ActiveDirectoryInteractive", $user, $password);
    if (!$connection)
    {
        echo (die(odbc_error()));
    }
    else
    {
        echo "Connection Successful !";
    }
    
    $sql =
    "SELECT TOP(10) 
      [BatchIdentifier]
    FROM [dw].[Fact_Demo]";
    
    $rs=odbc_exec($connection,$sql);
    
    if (!$rs) 
        {exit("Error in SQL");} 
    while($e=odbc_fetch_object($rs))
        { $output[]=$e;}
    print(json_encode($output));
?>
0 Answers
Related