Comments
17 comments
-
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 -
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. -
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 -
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 -
Is there any option to turn syntax highlight off ?
-
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 -
George Palacean wrote: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 -
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 (a int) select * from #t1 -- comment - marked as 'syntax error' /*this comment is also underlined*/ select * from #t1
-
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 LtdMikeONeill 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 -
Another example of comment underlining:
create table test ( a int, constraint PK_TEST primary key clustered ( a --that's the primary key - underlined as syntax error ) )
-
Thankyou for this example George. We have reproduced it and raised this as an issue.
I look forward to receiving more examples :-)
ChrisGeorge Palacean wrote:Another example of comment underlining:create table test ( a int, constraint PK_TEST primary key clustered ( a --that's the primary key - underlined as syntax error ) )
-
SELECT @Count = Count(1)
FROM MyTable (nolock)
WHERE MyID = 0
incorrectly underlining the nolock hint -
Thanks for this query, I have raised this as an issue.
Thank you for your continuing interest in SQL Prompt 4.0!
Chrisbfox wrote:SELECT @Count = Count(1)
FROM MyTable (nolock)
WHERE MyID = 0
incorrectly underlining the nolock hint -
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 -
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... -
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';
-
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.
Add comment
Please sign in to leave a comment.
Still playing around with it. I look forward to seeing the evolution of this as the beta program progresses.