October 19, 2017 at 12:33 pm
I have a couple long (1000+ lines) queries in development. I tend to use a lot of CTEs, and throw in columns that seem helpful at the time, but may not be used in the final query.
Does anyone know a tool that will scan a query and list columns that have been included in a CTE but are not used later in the query? Kind of like how Visual Studio will complain if you declare a variable but don't use it.
I've looked at SSMS and Aqua Data for something like this, but haven't found it.
Thanks,
October 24, 2017 at 9:35 am
Hi,
I think that you should read the article in the link, apply to Oracle, but SQL Server too.
https://stackoverflow.com/questions/25186267/managing-very-large-sql-queries
Good Luck
October 24, 2017 at 12:30 pm
palandri - Thursday, October 19, 2017 12:33 PMI have a couple long (1000+ lines) queries in development. I tend to use a lot of CTEs, and throw in columns that seem helpful at the time, but may not be used in the final query.Does anyone know a tool that will scan a query and list columns that have been included in a CTE but are not used later in the query? Kind of like how Visual Studio will complain if you declare a variable but don't use it.
I've looked at SSMS and Aqua Data for something like this, but haven't found it.
Thanks,
If a column is included in a CTE but not used in the final query, it will be ignored. Unless, it's used as part of a filtering or grouping option.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply