execute to cursor

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
tzoschke
Posts: 4
Joined: Wed 23 May 2018 15:38

execute to cursor

Post by tzoschke » Wed 23 May 2018 15:46

I cannot get execute to cursor to work when using a CTE.

example:
with cteone as
(
select a.field
from table1 a
)
select * from cteone <-- Cursor placed here and execute to cursor returns error

,ctetwo as
(
select b.field
from table2 b
)
select *
from cteone

alexa

Re: execute to cursor

Post by alexa » Thu 24 May 2018 11:10

Because the script contains an error, instead of the 'Execute To Cursor' command, you need to select the part of the script to execute, right-click and invoke the 'Execute Selection' command from the popup menu.

tzoschke
Posts: 4
Joined: Wed 23 May 2018 15:38

Re: execute to cursor

Post by tzoschke » Thu 24 May 2018 14:34

The script does not contain an error. If you're talking about having the select statement and then another cte then it truly isn't an execute to cursor function.

What you're saying is that any error past the cursor is also looked at even though it would be better if it didn't look past the cursor.

I realize you can highlight and execute a query. That is basic SSMS functionality. A more direct answer would be that it doesn't work with CTE.

alexa

Re: execute to cursor

Post by alexa » Tue 29 May 2018 09:35

That's right. That's the behavior of dbForge SQL Complete. Also, you can add a suggestion on our UserVoice forum where other users can vote for it https://devart.uservoice.com/forums/87893-sql-complete

We collect and analyze the information from this forum in order to make a proper roadmap for the future product releases.

Post Reply