Repository: sql-formatter-org/sql-formatter (ts)

Issue:
SQLServer errors
**Describe the bug**
This is similar to this closed issue: https://github.com/sql-formatter-org/sql-formatter/issues/700. I'm unable to format a valid SQLServer statement. Using the [demo](https://sql-formatter-org.github.io/sql-formatter/), there appears to be no language selection that doesn't error.

**Expected behavior**
Output should be formatted.

**Actual behavior**
Got this error:
```
Error: Parse error: Unexpected "[Contact] " at line 1 column 6.
This likely happens because you're using the default "sql" dialect.
If possible, please select a more specific dialect (like sqlite, postgresql, etc).
```

**Usage**
```javascript
import { format } from 'sql-formatter';
let sql_string = "WITH [Contact] AS (SELECT [ContactID], [FirstName], [LastName] FROM [dbo].[Contact])";
format(sql_string, { language: 'sql' })
```

- What SQL language(s) does this apply to?
SQLServer

- Which SQL Formatter version are you using?
```
sql
```

I'm on 15.3.1 so I figured opening a new issue was prudent.




Pull request description:
Allow ODBC date format. Closes #877
Supports the [ODBC date format](https://learn.microsoft.com/en-us/sql/t-sql/data-types/date-transact-sql?view=sql-server-ver17#odbc-date-format) by specifying `{}` as `stringTypes`.

Patch:
diff --git a/src/languages/transactsql/transactsql.formatter.ts b/src/languages/transactsql/transactsql.formatter.ts
index d94f51a5..497a27f9 100644
--- a/src/languages/transactsql/transactsql.formatter.ts
+++ b/src/languages/transactsql/transactsql.formatter.ts
@@ -246,7 +246,10 @@ export const transactsql: DialectOptions = {
     reservedDataTypes: dataTypes,
     reservedFunctionNames: functions,
     nestedBlockComments: true,
-    stringTypes: [{ quote: "''-qq", prefixes: ['N'] }],
+    stringTypes: [
+      { quote: "''-qq", prefixes: ['N'] },
+      '{}'
+    ],
     identTypes: [`""-qq`, '[]'],
     identChars: { first: '#@', rest: '#@$' },
     paramTypes: { named: ['@'], quoted: ['@'] },


Test patch:
diff --git a/test/transactsql.test.ts b/test/transactsql.test.ts
index f78d0e5b..a620489c 100644
--- a/test/transactsql.test.ts
+++ b/test/transactsql.test.ts
@@ -227,4 +227,22 @@ describe('TransactSqlFormatter', () => {
         Zone
     `);
   });
+
+  // Issue #877
+  it('allows the use of the ODBC date format', () => {
+    const result = format(
+      `WITH [sales_query] AS (SELECT [customerId] FROM [segments].dbo.[sales] WHERE [salesdate] > {d'2024-01-01'})`
+    );
+    expect(result).toBe(dedent`
+      WITH
+        [sales_query] AS (
+          SELECT
+            [customerId]
+          FROM
+            [segments].dbo.[sales]
+          WHERE
+            [salesdate] > {d'2024-01-01'}
+        )
+    `);
+  });
 });