TherChenYang opened a new pull request, #29426:
URL: https://github.com/apache/shardingsphere/pull/29426
Fixes #29170.
Changes proposed in this pull request:
Support parsing SQL Server
```
SELECT COUNT(*) AS [Number of rows] FROM #Test
```
```
SELECT obj1.name AS [XEvent-name],
col2.name AS [XEvent-column],
obj1.description AS [Descr-name],
col2.description AS [Descr-column]
FROM sys.dm_xe_objects AS obj1
INNER JOIN sys.dm_xe_object_columns AS col2
ON col2.object_name = obj1.name
ORDER BY obj1.name,
col2.name
```
Related document
- sys.dm_exec_sql_text function
[link](https://learn.microsoft.com/zh-tw/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-sql-text-transact-sql?view=sql-server-ver16)
```
INSERT INTO TestSchema.Employees (Name, Location) VALUES
(N'Jared', N'Australia'),
(N'Nikita', N'India'),
(N'Tom', N'Germany')
```
```
SELECT query = a.text, start_time, percent_complete,
eta = dateadd(second,estimated_completion_time/1000, getdate())
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) a
WHERE r.command = 'RESTORE DATABASE'
```
Related document
- CROSS APPLY
[link](https://learn.microsoft.com/zh-tw/sql/t-sql/queries/from-transact-sql?view=sql-server-ver16)
- Use equal signs to set aliases
[link](https://learn.microsoft.com/zh-cn/sql/t-sql/queries/select-clause-transact-sql?view=sql-server-ver16)
---
Before committing this PR, I'm sure that I have checked the following
options:
- [x] My code follows the [code of
conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/)
of this project.
- [x] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the
pull request.
- [x] I have passed maven check locally : `./mvnw clean install -B -T1C
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
- [ ] I have made corresponding changes to the documentation.
- [x] I have added corresponding unit tests for my changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]