SQL error, please help - "Invalid Cursor State"
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Trying to pull monthly data for a portfolio, I have 600k+ rows on 30+ fields. ODBC connection seems fine, but when importing the code I get the following errors - looks like it might be a memory management issue? Would appreciate the help from anyone. (Blacked out server names)
Solved! Go to Solution.
- Labels:
- Database Connection
- Datasets
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
No, I just copied my usual query from SQL Server Studio into Alteryx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is a little bit of a long shot; but the SQL editor/Input Data tool doesn't handle text that's copied and pasted from other SQL editors well. Usually the cause is rich text format which most other sql editors have and this one doesn't. To check for this being the cause, you may have to re-write your sql in the sql editor within Alteryx.
Sometimes I've heard of users having luck by pasting into Notepad (not Notepad++, Word, or any other application), saving it, closing, re-opening, then copy and paste. Plain old Notepad doesn't support rich text and this will eliminate the chance of that getting pasted as well.
It's worth a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I tried pasting into Notepad first, and it looks like it might've cleared the first error but now I'm getting the error message below. Any chance you can help out with that one?
"Error: Input Data (3): Error SQLExecute: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cursors are not supported on a table which has a clustered columnstore index.[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Statement(s) could not be prepared."
Thanks,
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@mattd17 I'd have to look at the SQL and know a bit more about the database to say for sure. Better to check with a DBA.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I've had this error before and adding a "BEGIN" before your query then "SET NOCOUNT ON END" after solved the problem.
So it should look like this:
BEGIN
/***Insert Query Here***/
SET NOCOUNT ON
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This works! God bless you, my friend!🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This worked for me as well. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Kudos, it worked perfectly! Thank you!
