Not sure what's going on here, but I see a lot of red lines when trying to write T-SQL Code in SSMS 2008. At one point, I would arrow up or down and the red lines would move around the screen as I did that. It didn't look like there was a particular pattern as to why they appeared, especially since their location changed with the location of the cursor.

Still playing around with it. I look forward to seeing the evolution of this as the beta program progresses.
paschott
0

Comments

17 comments

  • tanya
    Hello,

    The red underlines are indicative of SQL errors in the script.
    Would it be possible for you to send us the script so that we can identify the issue related to the moving around of the squigglies?

    Thanks,
    Tanya
    Project Manager
    Red Gate Software Ltd
    tanya
    0
  • paschott
    I could send you just about anything, but it seems to happen almost anytime I open a script from a file or script out a trigger/stored proc recently. To whom should I send the script once I obtain one?

    Thanks.
    paschott
    0
  • MikeONeill
    Hi

    I agree , I have code which works fine that is literally scattered with squiggles in red and the tooltip showing "Syntax Error" when the code executes as expected .

    I like the concept , as I often get to the point of LayoutSQL with the odd error but you never quite see where it is .

    The error indication is good and paralells well with Visual Studio

    Cheers

    Mike
    MikeONeill
    0
  • Chris George
    Hi

    Please send us some examples of such queries with details of where the "red squigglies" are being displayed, it may help to identify where our error detection is going a bit wonky!

    Regards

    Chris
    Chris George
    0
  • George Palacean
    Is there any option to turn syntax highlight off ?
    George Palacean
    0
  • MikeONeill
    This is a good example , it seems to be not liking the #Machine

    I'm not sure if you can replicate not having the Db

    All the Inner Joins are underlined

    -- Retrieve Unique List of Machines
    INSERT INTO #Machines (Machine, MachineDesc)
    EXECUTE dbo.SelectMachineBy @LotSummaryName = 'PA-MATUR,PA-FERME,PA-FLAVO,PA-FILTR,PA-DABPR', @BrandCode = '-1', @MachineType = 'Bright Beer Tank,Fermentation Vessel,Storage Vessel', @ExcludeOffline = 1


    INSERT INTO @Inventory
    SELECT DISTINCT MT.Machine
    ,ISNULL(L.LotID, '')
    ,ISNULL(R.[Description], 'None')
    ,QuantityStart = ISNULL(dbo.fncLotDestinationQuantity(L.LotID, @SelectedDate), 0)
    ,QuantityCurrent = ISNULL(L.PrimaryQty, 0)
    ,ISNULL(B.ShortDescription, '')
    ,ISNULL(B.LongDescription, '')
    ,ISNULL(L.MaterialName, '')
    ,ISNULL(L.MaterialVersion, '')
    ,ISNULL(SUBSTRING(M.MaterialName, 3, 10) , '')
    ,ISNULL(M.Description, '')
    ,FilledOn = ISNULL(dbo.fncFilledOn(L.LotID), '')
    ,StdGravity = ISNULL(dbo.fncStdGravity(L.LotID, 0), 0)
    ,Actual = ISNULL(dbo.fncStdGravity(L.LotID, 1), 0)
    ,ProcessTimeTarget = ISNULL(CASE WHEN R.RouteName LIKE 'Fermentation%' THEN BA.FVDaysProcess WHEN R.RouteName LIKE 'Maturation%' THEN BA.SVDaysProcess WHEN R.RouteName LIKE 'Filtration%' THEN BA.BBTDaysProcess END, 0)
    ,ISNULL(LI.CreateTimeLogged, '')
    ,CreateDate = ISNULL(LI.DueDate, '')
    ,ISNULL(R.paqtMenuCol, 0)
    ,ISNULL(R.DisplayOrder, 0)
    ,ISNULL(MC.Location, '')
    ,ISNULL(L.FinishedOn, '')
    ,'IN_USE'
    ,NULL
    FROM
    #Machines MT
    INNER JOIN Machine MC ON MT.Machine = MC.Machine
    INNER JOIN StartLog SL ON MT.Machine = SL.Machine
    INNER JOIN LotBaseLog LBL ON LBL.BaselogID = SL.TransLogID AND Undone = 'False'
    INNER JOIN Lot L ON L.LotID = LBL.LotID AND L.FinishedOn > @SelectedDate
    INNER JOIN Route R ON LBL.RouteName = R.RouteName AND LBL.RouteVersion = R.RouteVersion
    LEFT OUTER JOIN LotInfo LI ON L.LotID = LI.LotID
    INNER JOIN Material M ON L.MaterialName = M.MaterialName AND L.MaterialVersion = M.MaterialVersion
    INNER JOIN Brand B ON B.pkBrandCode = M.fkBrandCode
    INNER JOIN BeerAvailability BA ON BA.fkBrandCode = B.pkBrandCode
    WHERE
    LBL.TimeLogged <= @SelectedDate
    AND L.FinishedOn >= @SelectedDate
    ORDER BY MT.Machine
    MikeONeill
    0
  • tanya
    Is there any option to turn syntax highlight off ?

    Hi George,

    We do not have an option to turn off syntax highlighting on the EAP. But this is something we are considering to include for the final release.
    Are you looking at turning off the functionality because you think it seems to be underlining SQL that is not erroneous or is it because you do not see any benefit out of the feature?

    Thanks,
    Tanya
    Project Manager
    Red Gate Software Ltd
    tanya
    0
  • George Palacean
    It's because it's underlining correct SQL (temp tables which I know are not implemented yet, but sometimes even comments).

    For example, in SSMS 2008:
    create table #t1 &#40;a int&#41;
    
    select *
    from #t1
    
    -- comment - marked as 'syntax error'
    
    /*this comment is also underlined*/
    
    select *
    from #t1
    
    George Palacean
    0
  • tanya
    Hi Mike,

    Thank you for the feedback and the script.
    It is because temporary tables are not understood by SQL Prompt as yet as the functionality is not implemented. However, this will be resolved in the next release build.

    Thanks,
    Tanya
    Project Manager
    Red Gate Software Ltd


    MikeONeill wrote:
    This is a good example , it seems to be not liking the #Machine

    I'm not sure if you can replicate not having the Db

    All the Inner Joins are underlined

    -- Retrieve Unique List of Machines
    INSERT INTO #Machines (Machine, MachineDesc)
    EXECUTE dbo.SelectMachineBy @LotSummaryName = 'PA-MATUR,PA-FERME,PA-FLAVO,PA-FILTR,PA-DABPR', @BrandCode = '-1', @MachineType = 'Bright Beer Tank,Fermentation Vessel,Storage Vessel', @ExcludeOffline = 1


    INSERT INTO @Inventory
    SELECT DISTINCT MT.Machine
    ,ISNULL(L.LotID, '')
    ,ISNULL(R.[Description], 'None')
    ,QuantityStart = ISNULL(dbo.fncLotDestinationQuantity(L.LotID, @SelectedDate), 0)
    ,QuantityCurrent = ISNULL(L.PrimaryQty, 0)
    ,ISNULL(B.ShortDescription, '')
    ,ISNULL(B.LongDescription, '')
    ,ISNULL(L.MaterialName, '')
    ,ISNULL(L.MaterialVersion, '')
    ,ISNULL(SUBSTRING(M.MaterialName, 3, 10) , '')
    ,ISNULL(M.Description, '')
    ,FilledOn = ISNULL(dbo.fncFilledOn(L.LotID), '')
    ,StdGravity = ISNULL(dbo.fncStdGravity(L.LotID, 0), 0)
    ,Actual = ISNULL(dbo.fncStdGravity(L.LotID, 1), 0)
    ,ProcessTimeTarget = ISNULL(CASE WHEN R.RouteName LIKE 'Fermentation%' THEN BA.FVDaysProcess WHEN R.RouteName LIKE 'Maturation%' THEN BA.SVDaysProcess WHEN R.RouteName LIKE 'Filtration%' THEN BA.BBTDaysProcess END, 0)
    ,ISNULL(LI.CreateTimeLogged, '')
    ,CreateDate = ISNULL(LI.DueDate, '')
    ,ISNULL(R.paqtMenuCol, 0)
    ,ISNULL(R.DisplayOrder, 0)
    ,ISNULL(MC.Location, '')
    ,ISNULL(L.FinishedOn, '')
    ,'IN_USE'
    ,NULL
    FROM
    #Machines MT
    INNER JOIN Machine MC ON MT.Machine = MC.Machine
    INNER JOIN StartLog SL ON MT.Machine = SL.Machine
    INNER JOIN LotBaseLog LBL ON LBL.BaselogID = SL.TransLogID AND Undone = 'False'
    INNER JOIN Lot L ON L.LotID = LBL.LotID AND L.FinishedOn > @SelectedDate
    INNER JOIN Route R ON LBL.RouteName = R.RouteName AND LBL.RouteVersion = R.RouteVersion
    LEFT OUTER JOIN LotInfo LI ON L.LotID = LI.LotID
    INNER JOIN Material M ON L.MaterialName = M.MaterialName AND L.MaterialVersion = M.MaterialVersion
    INNER JOIN Brand B ON B.pkBrandCode = M.fkBrandCode
    INNER JOIN BeerAvailability BA ON BA.fkBrandCode = B.pkBrandCode
    WHERE
    LBL.TimeLogged <= @SelectedDate
    AND L.FinishedOn >= @SelectedDate
    ORDER BY MT.Machine
    tanya
    0
  • George Palacean
    Another example of comment underlining:
    create table test &#40;
    	a int,
    	constraint PK_TEST primary key clustered &#40;
    		a --that's the primary key - underlined as syntax error
    	&#41;
    &#41;
    
    George Palacean
    0
  • Chris George
    Thankyou for this example George. We have reproduced it and raised this as an issue.

    I look forward to receiving more examples :-)

    Chris
    Another example of comment underlining:
    create table test &#40;
    	a int,
    	constraint PK_TEST primary key clustered &#40;
    		a --that's the primary key - underlined as syntax error
    	&#41;
    &#41;
    
    Chris George
    0
  • bfox
    SELECT @Count = Count(1)
    FROM MyTable (nolock)
    WHERE MyID = 0

    incorrectly underlining the nolock hint
    bfox
    0
  • Chris George
    Thanks for this query, I have raised this as an issue.

    Thank you for your continuing interest in SQL Prompt 4.0!

    Chris
    bfox wrote:
    SELECT @Count = Count(1)
    FROM MyTable (nolock)
    WHERE MyID = 0

    incorrectly underlining the nolock hint
    Chris George
    0
  • fatherjack2
    I have found that a lot of red underlines are resolved by adding:

    USE <database>
    GO

    to the top of every script.

    Its certainly not 100% but it gets rid of a lot.

    Jonathan
    fatherjack2
    0
  • geophphrie
    Even assuming that syntax error highlighting will work perfectly, it is the sort of thing I wouldn't want on all the time. I code quickly and accurately most of the time, and would find the underlines visually distracting whilst I am crafting a new query for the first 95% of the time it takes to figure out how the view/proc/fn is going to work, during which time of course there will be some "errors" since the code is incomplete. I would likely turn it on for the 5% effort of fixing any latent brokenness in what I wrote. Might be nice to have a hotkey to kick on the "spellcheck"...

    Note that turning off auto spell and grammar checking is pretty much the first thing I do after installing OpenOffice...
    geophphrie
    0
  • MCTSQL
    There appears to be an association with "red-lining" and the size of a multi-line comment block within a file containing 5,065 or more characters. If you take the following sample code of 5,065 characters, then go to the end of the file (ctrl-end), you will get a pretty screen of red waves. To remove the red-lining, simply remove any one character from the file (such that it still parses successfully). Cool huh? :)
    (Note that each line except for the last line is expected to have a carriage return and linefeed at the end.)
    create procedure abc/*
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
       My Big Block of Comments My Big Block of Comments My Big Block of Comments
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/as select 'My Big Block of Comment';
    
    MCTSQL
    0
  • Michael.Kriegner
    I agree with geophphrie. Sometimes I write a single line of code in middle of a procedure/function, just to select this line, execute it (for testing something or getting info) and delete the line.

    I often get the whole screen with red lines and while tipping the code, they are flickering very nervous. That's very annoying and would also be a reason for me, to turn it off.

    Besides, I got many exceptions (most times object null references) so I had to deinstall it. Version 3.9 works fine.
    Michael.Kriegner
    0

Add comment

Please sign in to leave a comment.