-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
re: execute rollback when getting column info from stored procedure that also executes updates #23
Comments
Another way to skin this cat would be to use a stored procedure parameter This should work, but it is a bit of pain, especially when the stored procedure is complicated. |
Using a transaction that is rolled back seems like a good idea. I assume the procedure is using dynamic SQL? |
No, the stored procedure does not use dynamic SQL. It simply modifies some rows, then it returns them in a temp table. The problem is that, whatever method the generator uses to figure out the structure of the select statement that gets returned, it actually runs the stored procedure and it makes changes to the data. |
Yes, that is a (documented) feature. Nevermind dynamic SQL. I remember now that in addition to procedures and scripts with dynamic SQL, stored procedures sometimes need this even if they don't contain dynamic SQL. I'll implement the transaction rollback. |
Thank you!! |
Hi,
I am not too sure this doable, but I will put it out there. I have a stored procedure that updates records based on some condition, it puts the modified records in a temp table using an output clause, then it returns the data from the temp table.
The problem is that when the generator runs it gets the columns information from the stored procedure, but it also executes the stored procedure, and it commits the data. Is it possible to place the operation that gets the columns information in a transaction, get the structure of the resultset, then rollback then entire thing? Otherwise it is a bit annoying because I have to reset that data to undo the operation and to go back to the previous state.
Thank you
The text was updated successfully, but these errors were encountered: