SQL Parser throws a syntax error during the parsing of a T-SQL query that contains keyword 'PARTITION'
说明
SQL Parser throws a syntax error during the parsing of a T-SQL query that contains keyword 'PARTITION'
Add a server and a database for auditing using Extended event data collection.
Run the query below on the audited server:
-- Prepare CREATE TABLE [dbo].[Table_1]( [col1] [nchar](10) NULL ) ON [PRIMARY] GO
CREATE TABLE [dbo].[Table_2]( [col1] [nchar](10) NULL ) ON [PRIMARY] GO
-- Run ALTER TABLE dbo.Table_1 SWITCH TO dbo.Table_2 PARTITION 8 WITH (WAIT_AT_LOW_PRIORITY (MAX_DURATION = 1 MINUTES, ABORT_AFTER_WAIT = BLOCKERS)) GO
-- Cleanup DROP TABLE dbo.Table_1 DROP TABLE dbo.Table_2 GO
The SQL Parser will throw an error: 'Syntax error, state:78(10101) near: PARTITION(3,27) (10022) near: PARTITION(3,27) no_root_node(-1000) near: no root node(0,0)'
解决办法
WORKAROUND None
STATUS Waiting for fix in a future release of ApexSQL Audit.