error formatting valid SQL

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
[email protected]
Posts: 2
Joined: Thu 07 Dec 2017 16:47

error formatting valid SQL

Post by [email protected] » Thu 07 Dec 2017 16:53

Hi,
When I try to format the below SQL using "Format Document", I get a couple errors:
Error (5,41): '','' expected
Error (14,41): '')'' expected

This is valid SQL that runs fine, but SQL Complete is unable to format it for some reason. Here's the SQL:

Code: Select all

SELECT
	p.Id AS [datasetItemId],
	p.HashKeyId AS [hashKeyId],
	(
		SELECT
			geography::UnionAggregate(l.geography)
		FROM Location pod
		WHERE l.PlaceId = p.Id
	) AS geography,
	(
		SELECT
			p.Id,
			p.FileNumber,
			p.Owner,
			p.Type,
			p.Status,
			p.SurfaceSubBasin,
			p.GroundWaterBasin,
			p.LinkToSummary,
			p.HashKeyId,
			ISNULL(JSON_QUERY(
					(
						SELECT
							l.Id,
							l.PlaceId,
							l.NameOrNumber,
							l.Status,
							l.GroundWaterSource,
							l.DepthOfWellFeet,
							l.DepthToWaterFeet,
							l.UTMSource,
							l.UTMAccuracy,
							l.OtherLocation,
							l.LocationError,
							l.LinkToSummary,
							l.Geography.STAsText() AS Geography
						FROM dbo.Location l 
						WHERE l.PlaceId = p.Id
						FOR JSON PATH
					)
				), '[]') AS Locations
		FOR JSON PATH, WITHOUT_ARRAY_WRAPPER, INCLUDE_NULL_VALUES
	) AS datasetItem
FROM dbo.Place p

alexa

Re: error formatting valid SQL

Post by alexa » Fri 08 Dec 2017 16:26

We will investigate this issue and will answer you as soon as possible.

alexa

Re: error formatting valid SQL

Post by alexa » Mon 11 Dec 2017 11:08

We will fix this issue in one of the next product builds and will notify you once it's available for downloading.

[email protected]
Posts: 2
Joined: Thu 07 Dec 2017 16:47

Re: error formatting valid SQL

Post by [email protected] » Mon 11 Dec 2017 16:25

Thank you.

AlexandrS
Devart Team
Posts: 20
Joined: Mon 22 Jan 2018 11:27

Re: error formatting valid SQL

Post by AlexandrS » Fri 09 Feb 2018 09:34

Hello!

Hope this email finds you well,

Just following up on the ticket and want to inform you that there is a new version of SQL Complete available.

You can download it from: https://www.devart.com/dbforge/sql/sqlc ... nload.html

Best regards,
Alexander Sergeev
Devart Team
http://www.devart.com

Post Reply