What are the challenges you face when working across database platforms? Take the survey
Options

Multiple semicolon insert

schematechschematech Posts: 19
edited October 29, 2014 6:25AM in SQL Prompt
If I have code like this fragment:
declare @old int, @new int
....
if @old <> @new
    exec dbo.spSomeProc @new

Ctrl-B, C correctly adds a ; to the end of the exec statement. However, further Ctrl-B, C keep adding more.
declare @old int, @new int;
....
if @old <> @new
    exec dbo.spSomeProc @new;;;;
If I do this, it doesn't go wrong:
declare @old int, @new int;
....
if @old <> @new begin
	exec dbo.spSomeProc @new;
end;

Comments

  • Options
    Aaron LAaron L Posts: 596 New member
    Hi schematech,

    Sorry you've hit this (we've had a couple others around semicolons with exec and we thought that we'd fixed them all!) but thank you very much for reporting it.

    I can recreate the extra semicolon being inserted here and I think I've got a fix for you in this private build if you'd be able to give it a try?

    Thanks,
    Aaron.
  • Options
    Thanks Aaron.
    Before I install that, let me check something with you. I am already using v6.4.1.85 which was a 'private build' posted by David Priddle in response to a bug reported concerning the WAITFOR statement with Service Broker queues. As this is something we use a lot, I decided to use that version, rightly or wrongly.
    Does your private build include this fix?

    Regards,
    Bob
  • Options
    Aaron LAaron L Posts: 596 New member
    Hi Bob,

    This build does include the fix that David made in 6.4.1.85. You will have to uninstall the previous private build before it'll allow you to install this one, sorry for the inconvenience!
  • Options
    Thanks, Aaron - installed and functioning fine :D

    Bob
  • Options
    Aaron LAaron L Posts: 596 New member
    Thanks for confirming the fix! It's just a quick patch at the moment but we'll do some additional testing and should have it included in the stable build next week.
Sign In or Register to comment.