Getting an Invalid Cursor state error in the forge process of an Endeca baseline - endeca

Error in the forge log is Unable to determine the number of columns in the ODBC result: [Microsoft][SQL Native Client]Invalid cursor state
Endeca is a bit black-box, so I'm not sure exactly what sql call is causing this error

Glenn,
In SQLServer 2005 (and perhaps other SQLServer versions), calls to ODBC SQLNumResultCols have been known to return invalid column counts or throw errors when the query is a call to a non-trivial stored procedure. If your query calls a stored procedure, see if you derive the same outcome using direct table or view reads, perhaps combined with logic in Forge.
Brett

Related

How to resolve an intermittent issue in linked server?

Getting the below intermittent error, when inserting the records in Oracle DB using a stored procedure in SQL via linked server.
The OLE DB provider "OraOLEDB.Oracle" for linked server "linkedServer" supplied inconsistent metadata. An extra column was supplied during execution that was not found at compile time.
When I re-run the stored procedure with same arguments again and its successful.

Azure Logic Apps SQL Connector Error: Bad Request

I'm using the SQL Connector in Azure Logic Apps to connect to our Azure SQL Database to perform queries, update tables, and execute stored procedures. After several months of developing logic apps, I'm seeing the below error message when using the SQL Connector "Execute Stored Procedure (V2)". I'm only encountering this error with this specific connector. All the other connectors work just fine. Has anyone encountered this error before and had success troubleshooting?
Error:
Could not retrieve values. Error code: 'BadRequest', Message: 'The value's length for key 'application name' exceeds it's limit of '128'.
clientRequestId: 'XXXXX'. More diagnostic information: x-ms-client-request-id is 'XXXXX'.
Just had a call with Microsoft Support and got confirmation: this is the global issue in the SQL connector of LogicApp. They are working on this to fix, no ETA for now.
Update: should be fixed from around 29.03.2022 03:00 CET

OLE DB or ODBC error. The current operation was cancelled because another operation in the transaction failed

OLE DB or ODBC error.
An error occurred while processing table 'Query 1'.
The current operation was cancelled because another operation in the transaction failed.
Out of line object 'DataSourceView', referring to ID(s) 'Temp_DSV', has been specified but has not been used.
I got the above error when i ran a query in Power Pivot for excel. Can somebody tell me , what might be the reason?
i got this message error too in mylast 7 days.
My solution is running first in example select top 10 * in sql server management studio, then go to excel, running query in power pivot again.
I dont know why this is solve, but it save me, in many times.
Maybe your query exceeds the memory limitations of 32bit Excel. Try to limit your query with a WHERE clause.
Also see this related question:
How to debug OLE DB or ODBC error (import data from MySql to Excel)

Handle nested SQL statements in SQL Server

My procedure has large query syntax, many "nested if else" when I create it on one SQL Server I get this error:
Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.
but when I create that on another server, it is created without error. I know the procedure has poor performance but why that is created correctly on another server
Does it depend on server config or database feature ?
when i create that on another server,that is created without error
Reason is that the two version is not same . I think you 1st server is older than 2012sp1 that's why you got that error. you can check this link

Stored Procedure usage in Azure SQL Database with Direct Query Mode

I have created stored procedures in Azure SQL Database and trying to use them power BI report with Direct Query mode. But getting the error like
"Microsoft SQL: Incorrect syntax near the keyword 'EXEC'. Incorrect syntax near ')'.
Another question is
how to set the connection string as global so that I can use the same connection string in multiple reports?
Please help me with the solution
I assume you are using Power BI Desktop. When it constructs a DirectQuery SQL query it does this:
Select column1
From (
YourQuery
) as t1
So it fails because you can't put EXEC in the from clause of a SELECT query.
Your options:
Stop using DirectQuery. Using a stored proc in cached mode will work because it just runs your query without any changes during refresh. Why would this not work for you?
Take the query out of the stored proc and put it inline into PBI Desktop. Then it should work with DirectQuery as long as it is a single statement simple select.
Regarding reusing the connection (and I assume you also mean reusing the model with calcs, relationships, etc) in another report. Turn on this new preview feature under PBI Desktop options and you can connect to a published dataset (the model/data/connection) in Power BI Service.