I don't see the syntax issue below. I'm using a subquery, because I'm building it up to do a cross-apply once I get that figured out.
SELECT
BulkColumn
FROM
(
SELECT CAST(BulkColumn AS xml) as BulkColumn
FROM OPENROWSET(BULK'c:\Flight03.xml',SINGLE_CLOB) as T
)
Error: Incorrect syntax near ')'.
Line # refers to the closing parenthesis at the bottom
The subquery, when run by itself works fine:
Select CAST(BulkColumn AS xml) as BulkColumn
FROM OPENROWSET(BULK'c:\Flight03.xml',SINGLE_CLOB) as T
So shouldn't I just be able to wrap it with parentheses and use it in another query?
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2019 Standard 10.0 (Build 17763: )