-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sql generation improvements #4164
Comments
How do you detemine "Name" is not a keyword in all different supported databases, today and in the future? |
Like I said, the keywords list should be maintained, and when new database version comes out, we updated the keywords list with updated provider version. |
Sound like a helluva lot of work for very little gain to me. |
Is there any value in not escaping the names? I don't think it would make any difference to the plan compiler in SQL Server. I think you could also argue that it's easier to read if everything is enclosed in Avoiding aliasing with the same name sounds like a reasonable simplification. |
Thanks, maybe I was wrong about the alias without [], I guess it's not worth to do this. |
@ryanlin1986 can you share a code listing that demonstrates where you are seeing the unneeded aliasing happening? In general we don't do this, but maybe you have found a case where we do. For example, here is a query we generate from RC1-final SELECT [b].[BlogId], [b].[Created], [b].[Url]
FROM [Blog] AS [b]
ORDER BY [b].[Url] |
@rowanmiller RC1-final is just fine, maintain the keywords list is not worth it, since RC-1 does this well, I close this now. |
select it.Name from Customer as it
instead of
select it.[Name] as [Name] from Customer as it
Two points:
#1, as [Name] is not necessary in this scenario.
#2, it.[Name] should be it.Name, since Name is not a keyword, I think it's better to maintain a keywords list and only use [] for keywords.
This will decrease the generated sql and much readable.
The text was updated successfully, but these errors were encountered: