I just found an interesting "feature" in one of my developers code. Is there a place to pass on "features" to the development Redgate developers?
The feature I ran into was found in the following code:
SELECT COUNT(BusinessID)
FROM BusinessData NOLOCK
The above comes from one of our monitoring stored procedures. The developer was trying to issue a WITH (NOLOCK) query hint, but in the above example the query was locking the table and causing deadlocke. Because SQL Server interprets the above NOLOCK is a table alias.
SQL Prompt should look for table alias names that are the same as query hints.
P.S> Yes, I know, most query hints are BAD and need to get flagged.
The feature I ran into was found in the following code:
SELECT COUNT(BusinessID)
FROM BusinessData NOLOCK
The above comes from one of our monitoring stored procedures. The developer was trying to issue a WITH (NOLOCK) query hint, but in the above example the query was locking the table and causing deadlocke. Because SQL Server interprets the above NOLOCK is a table alias.
SQL Prompt should look for table alias names that are the same as query hints.
P.S> Yes, I know, most query hints are BAD and need to get flagged.