Formatting for Synapse
I have started using Serverless SQL Pool within SSMS. I have seen and voted for a post for Intellisense, but it would be good to be able to format a query too. For example the below query:
SELECT cast(r.filepath(1) as varchar(100)) as [$FileName], ISNULL(SysRowId,0) AS _SysRowId, ISNULL(LSN,'') AS LSN, ISNULL(LastProcessedChangeDateTime,'1900-01-01') AS LastProcessedChangeDateTime, ISNULL(DataLakeModifiedDateTime,'1900-01-01') AS DataLakeModifiedDateTime, ISNULL(RECID,0) AS RECID, Language, Status, Stage, ISNULL(DataAreaId,'') AS DataAreaId, ISNULL(PARTITION,0) AS PARTITION, ISNULL(RECVERSION,0) AS RECVERSION
FROM OPENROWSET(BULK 'Tables/StgTable/*.csv'
,FORMAT = 'CSV', PARSERVERSION = '2.0', DATASOURCE ='wsds', ROWSETOPTIONS = '{"READOPTIONS":["ALLOWINCONSISTENTREADS"] }'
)
WITH (SysRowId bigInt, LSN nvarchar(60), LastProcessedChangeDateTime datetime2, DataLakeModifiedDateTime datetime2, RECID bigInt, Language nvarchar(7), Status int, Stage nvarchar(30), DataAreaId nvarchar(4), PARTITION bigInt, RECVERSION int) as r
When I try to format this, I get error messages in the output complaining of syntax errors.