Skip to content
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

Non-sargable rule logging error with *nested* built-in date/time functions with no column reference. #325

Open
rz-1 opened this issue Apr 25, 2023 · 0 comments

Comments

@rz-1
Copy link

rz-1 commented Apr 25, 2023

similar to #314

Seeing a non-sargable rule logging error with nested built-in date/time functions with no column reference.
The example below is sargable:

SELECT [Name] FROM Foo WHERE Foo.DateCreated BETWEEN DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0) AND DATEADD(DAY, 1, EOMONTH(DATEADD(MONTH, 0, GETDATE())));
EXPECTED: No errors logged.
ACTUAL: A non-sargable error is logged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant