Be the star of a SQL Prompt case study. Learn more.

How to disable square brackets around MATCH function in graph tables?

fhussainfhussain Posts: 2 New member

When formatting graph table query, the MATCH clause gets wrapped in square brackets. For example:

-- Find Restaurants that John likes
SELECT [Restaurant].[name]
FROM [Person], [likes], [Restaurant]
WHERE [MATCH] ([Person]-([likes])->[Restaurant])
AND [Person].[name] = 'John';

The MATCH shold not be quoted in square brackets.

Also the formatting does not like the > character as can be seen in the attached screenshot.

It seems SQL Prompt does not like formatting graph database query. More info on graph query can be found here: https://docs.microsoft.com/en-us/sql/relational-databases/graphs/sql-graph-sample?view=sql-server-ver15

Comments

  • Hi @fhussain

    The behavior we are expecting here is that SQL Prompt is identifying keywords defined as identifiers in your database and are wrapping them. 
    We suspect that the MATCH keyword is being identified as such.

    At present there does not appear to be a way to define which identifiers are wrapped or to list them out through SQL Prompt. It may be possible to run a check through SSMS using a query such as below to try and locate the record that is being hit in your instance.

    SELECT
      OBJECT_NAME(object_id) AS [object],
      name,
      seed_value,
      increment_value,
      last_value,
      is_not_for_replication
    FROM sys.identity_columns;<br>

    SQL Prompt does load in keywords from SSMS and it is an opt-in/opt-out scenario to wrap them.
     
    I would suggest possibly logging a request on our UserVoice page to expand functionality around the automation of specific identifiers. UserVoice allows our product users to log feature requests which would enhance their usage of our solutions and is reviewed by our development teams to help drive future updates to our products.
     
    The SQL Prompt UserVoice can be accessed here - https://redgate.uservoice.com/forums/94413-sql-prompt.
    Jon Kirkwood | Technical Support Engineer | Redgate Software
Sign In or Register to comment.