Error when Trigger Code starts with ;

Jelluh!Jelluh! Posts: 4
The Source Control software crashes (latest version) when the code within a trigger starts with ;
For example code below will crash the software:
CREATE TRIGGER [dbo].[trgCrashedCode]  ON [dbo].[Example]
AFTER UPDATE, INSERT
AS

   ;WITH cteCrashCode AS ---This line will let the software crash
    (
            SELECT COUNT(E.SurrogateKey) AS DummyResult, i.BusinessKey
            FROM dbo.Example E 
                     INNER JOIN inserted i ON i.BusinessKey = E.BusinessKey
           GROUP BY E.BusinessKey
    )
    UPDATE 
    SET CrashCalcColumn = cC.DummyResult
    FROM dbo.Example E
             INNER JOIN cteCrashCode cC ON cC.BusinessKey = E.BusinessKey
            

Please fix the software that it's not sensitive for semicolons or any other characters used within the code.
Also please update the software that if it may crash, that it specifies on which sql object that is!
It took me 4 hours to find the piece of code that was crashing the software :cry:

Rgds

Comments

  • Hi

    Thanks for your inquiry!
    I have created a ticket for this issue, and would like to take this issue offline for further troubleshooting.

    I will contact you through the case via the email listed for your forum account.

    Thanks for your time!

    Rick
    Ricky Ram
    Technical Support
    Red Gate Software Ltd.
  • Hi,

    This bug has been fixed in the current version of SQL Source Control.

    Thank you,
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
Sign In or Register to comment.