Skip to content

False negative on no whitespace before and/or after "*" or delimited identifier in SELECT list #152

Description

@srutzky

Little known fact, but at least some SQL dialects, such as T-SQL, don't require whitespace before or after certain characters in the SELECT list:

  • *
  • [
  • ]
  • (
  • )

The following are all completely valid T-SQL and I just confirmed that they all return the expected results without any errors:

SELECT*FROM sys.objects
SELECT *FROM sys.objects
SELECT* FROM sys.objects

SELECT[name]FROM sys.objects
SELECT [name]FROM sys.objects
SELECT[name] FROM sys.objects

SELECT*,[name]FROM sys.objects
SELECT[name],*FROM sys.objects

SELECT([name])FROM sys.objects

P.S. I'm not sure if this behavior relates to Issue #100 or not (in terms of how the * is handled).

Take care,
Solomon...
https://SqlQuantumLift.com/
https://SqlQuantumLeap.com/
https://SQLsharp.com/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions