Red Gate forums :: View topic - SQL Prompt 6.4 beta (6.4.0.537 - 26th August)
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 6
SQL Prompt 6 forum

SQL Prompt 6.4 beta (6.4.0.537 - 26th August)

Search in SQL Prompt 6 forum
Post new topic   Reply to topic
Jump to:  
Go to page Previous  1, 2, 3, 4  Next
Author Message
Aaron Law



Joined: 28 Jun 2013
Posts: 218
Location: Red Gate Software

PostPosted: Fri Jul 11, 2014 3:27 pm    Post subject: Reply with quote

Hi jmeyer,

I think I can recreate your issue with the insert into not working correctly if the table being inserted into and the table being selected from have the same column name - I'll look into a fix for you now.

For your linked server issue could you provide an example script of where it's going wrong?

Thanks!
Aaron.
Back to top
View user's profile Send private message
jmeyer



Joined: 05 Jun 2009
Posts: 15

PostPosted: Fri Jul 11, 2014 3:49 pm    Post subject: Reply with quote

Found another issue: I have set all SQL code to be capitalized. If I type the following statement and after "end" type a space character then "END" will be capitalized. However, if I type a TAB character then it will not be capitalized. If I press the TAB character after "EN" then it will insert the END capitalized from the suggestions.

SELECT CASE WHEN a=1 THEN 0 ELSE 1 end
Back to top
View user's profile Send private message
jmeyer



Joined: 05 Jun 2009
Posts: 15

PostPosted: Fri Jul 11, 2014 3:58 pm    Post subject: Reply with quote

Aaron: Re linked server issue: I unfortunately have not been able to create a simple repo that I can share. The issues are happening in large stored procedures that I'm unable to share
Back to top
View user's profile Send private message
jmeyer



Joined: 05 Jun 2009
Posts: 15

PostPosted: Fri Jul 11, 2014 4:08 pm    Post subject: Reply with quote

Found another formatting issue:
SELECT *
FROM dbo.staging_MONOGRAM_INVOICE_fact s
LEFT JOIN (SELECT agreement_id
, fm_processing_pct
, SUM(tot_disbs) AS fm_processing_tot_disbs
, SUM(tot_disb_amts) AS fm_processing_tot_disb_amts
, SUM(tot_cancs) AS fm_processing_tot_cancs
, SUM(tot_canc_amts) AS fm_processing_tot_canc_amts
, SUM(fm_processing_disb_fee) AS fm_processing_disb_fee
, SUM(fm_processing_canc_fee) AS fm_processing_canc_fee
, SUM(fm_processing_tot_fee) AS fm_processing_tot_fee
FROM dbo.staging_MONOGRAM_MARKETER_CHAN_fact f
WHERE excl_processing_fee = 0
GROUP BY agreement_id
, fm_processing_pct) mc
ON s.AGREEMENT_ID = mc.AGREEMENT_ID

"ON s.AGREEMENT_ID = mc.AGREEMENT_ID" will be changed to "ON s.AGREEMENT_ID = s.AGREEMENT_ID" and the subquery will not get the "f" aliases inside the sUM() statements
Back to top
View user's profile Send private message
Aaron Law



Joined: 28 Jun 2013
Posts: 218
Location: Red Gate Software

PostPosted: Fri Jul 11, 2014 5:44 pm    Post subject: Reply with quote

Thank you for reporting these! I think I have fixes for your issues in this private build (edit: link removed - changes now in the latest beta), although I wasn't able to recreate the mc alias being changed to s so if it's still happening I might need some more help recreating it.

It's the end of the day here, so I'll have to leave it until Monday before I move these changes into our beta build. Have a good weekend! Smile
Back to top
View user's profile Send private message
dbbishop



Joined: 13 Feb 2009
Posts: 11
Location: Kansas City, MO

PostPosted: Tue Jul 15, 2014 2:53 pm    Post subject: Reply with quote

Release notes state you can execute current batch with ALT-SHIFT-F5. What is the current batch? Is it from the top of the script to the cursor? Is it from the previous GO to the cursor?
Back to top
View user's profile Send private message
David Priddle



Joined: 28 Jan 2014
Posts: 36
Location: Red Gate Software, Cambridge

PostPosted: Tue Jul 15, 2014 3:01 pm    Post subject: Reply with quote

Hi dbbishop,

Execute Current Batch will look up from the cursor until it finds the previous GO, and then look down from the cursor until it finds the next GO.

If it can't find a GO above, it will use the start of the script. If it can't find a GO below, it will use the end of the script.

Is this the behaviour that you would expect?

Best regards,

David
Back to top
View user's profile Send private message Send e-mail
dbbishop



Joined: 13 Feb 2009
Posts: 11
Location: Kansas City, MO

PostPosted: Tue Jul 15, 2014 3:05 pm    Post subject: Re: Reply with quote

David,

Actually, no. If SHIFT-F5 executes the statement at the cursor, I would expect ALT-SHIFT-F% to execute from previous GO (or start of code) to the cursor, or at least have another option (CTRL-SHIFT-F5) to do that.

Most IDEs (e.g. VS) have an option to "Run to cursor".
I suppose I could simulate by adding a GO just after the block I want to execute, but heaven forbid if I forget to remove it. Very Happy
Back to top
View user's profile Send private message
KevinGreiner



Joined: 05 Mar 2012
Posts: 20
Location: United States

PostPosted: Tue Jul 15, 2014 3:14 pm    Post subject: Reply with quote

Problem: "Format SQL" causes window contents to scroll sometimes to a position that is not useful.

After using, "Format SQL" the window is usually scrolled so the cursor is on the last visible row. Then I always need to scroll the window so I can continue working.

If "Format SQL" doesn't change anything, the window isn't scrolled at all.

Suggestion: maintain the current scroll position. If this isn't possible, scroll the window so the cursor is centered vertically.

(If this is the wrong place for this feedback, please instruct me how to provide this in a better forum.)
Back to top
View user's profile Send private message
David Priddle



Joined: 28 Jan 2014
Posts: 36
Location: Red Gate Software, Cambridge

PostPosted: Tue Jul 15, 2014 3:24 pm    Post subject: Reply with quote

Hi dbbishop,

Would it be possible to give a scenario where this is useful for you?

Would you have this execute from the start of the script to the end of the current statement or execute from the last GO?

Best regards,

David
Back to top
View user's profile Send private message Send e-mail
dbbishop



Joined: 13 Feb 2009
Posts: 11
Location: Kansas City, MO

PostPosted: Tue Jul 15, 2014 4:16 pm    Post subject: Re: Reply with quote

I would expect it to run from the start to the cursor, similar to "run to cursor" capability of Visual Studio. Alternately, it would run from previous 'GO' to cursor. It would be nice to have that as a configuration option, then the user could chose.

As I develop code, I build shells, and then start at the top and develop each shell. I am constantly selecting a block of code and executing it. It would be so convenient to just have the cursor at the end of the block, and press a key to say, run to here.

I may have made a change to code that loads a staging table and subsequent code processes the data in the staging table. Prior to executing the remainder of the code, I want to make sure the expected results are in the staging table, so I highlight code from the start to the end of the load of the staging table, execute it, and look at the results before continuing.

And on it goes...
Back to top
View user's profile Send private message
David Priddle



Joined: 28 Jan 2014
Posts: 36
Location: Red Gate Software, Cambridge

PostPosted: Tue Jul 15, 2014 4:40 pm    Post subject: Reply with quote

Hi dbbishop,

We'll have this out later this week.

Best regards,

David
Back to top
View user's profile Send private message Send e-mail
Aaron Law



Joined: 28 Jun 2013
Posts: 218
Location: Red Gate Software

PostPosted: Wed Jul 16, 2014 11:46 am    Post subject: Reply with quote

Hi Kevin,

This is the perfect place for this kind of feedback! I think the scrolling is handled automatically by SSMS after we replace the text at the moment - I'll have a look into seeing if we can override the scroll position.
Back to top
View user's profile Send private message
Aaron Law



Joined: 28 Jun 2013
Posts: 218
Location: Red Gate Software

PostPosted: Wed Jul 16, 2014 5:00 pm    Post subject: Reply with quote

Hi Kevin,

Could you see if 6.4.0.268 works as you'd expect for scrolling after a format? It turned out to be a little more complicated that just keeping the current scroll position since formatting can insert or delete lines which shifts everything around, so I've tried to use the caret position as an anchor point.

Thanks,
Aaron.
Back to top
View user's profile Send private message
KevinGreiner



Joined: 05 Mar 2012
Posts: 20
Location: United States

PostPosted: Wed Jul 16, 2014 6:59 pm    Post subject: Reply with quote

Very nice, Aaron. It works 99% perfectly. Smile

When the cursor is in the middle of a line or at the end, it works perfectly. However, when the cursor is at the beginning of a line, the window scrolls one line down and the cursor is moved up one line.

To reproduce:
1. Put cusor at beginning of a line.
2. Run "Format SQL".
3. Note display is scrolled up 1 line and cursor position is changed.
4. Run "Format SQL" again.
5. Note that nothings moves on the screen.

One more thing.....

Not new to this beta, but the Options window takes roughly 15 seconds to close now. The first 5-7 seconds are completely frozen without a wait mouse cursor. In prior major releases, this dialog closed quickly.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Go to page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group