Skip to content

SQL Server hints are not supported #915

@cdandoy

Description

@cdandoy

Describe the bug
The syntax for SQL Server hints is missing.
https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query?view=sql-server-ver15

To Reproduce
Here are a few examples of query hints.

-- Setup
DROP TABLE IF EXISTS tableName1;
CREATE TABLE tableName1(id INT);
CREATE INDEX idx1 ON tableName1 (id);

DROP TABLE IF EXISTS tableName2;
CREATE TABLE tableName2(id INT);
CREATE INDEX idx2 ON tableName2 (id);

-- Examples
SELECT 1 FROM tableName1 AS t1 WITH (INDEX (idx1)) JOIN tableName2 AS t2 WITH (INDEX (idx2)) ON t1.id = t2.id;
SELECT 1 FROM tableName1 WITH (NOLOCK);
SELECT 1 FROM tableName1 WITH (INDEX (idx1), NOLOCK);

System

  • SQL Server 2019
  • JSqlParser 3.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions