July 24, 2018 at 8:25 am
usererror - Tuesday, July 24, 2018 7:31 AMSteve,
This may be a silly question, but what is the significance of '_LIMITED' that you appended to the original table name "INS4" so it was 'INS4_LIMITED' on the subquery you made containing the WITH clause?
Thanks,
Mark
INS4_LIMITED is the name he gave to the result set returned by the CTE so that he could reference later in the query. It could have been named ANYTHING, but it's a common practice to have self documenting code including having names that are indicative of what the object represents. In this case, the CTE returns a limited set of rows from the INS4 table, hence the self-documenting name of INS4_LIMITED.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 24, 2018 at 9:19 am
drew.allen - Tuesday, July 24, 2018 8:25 AMINS4_LIMITED is the name he gave to the result set returned by the CTE so that he could reference later in the query. It could have been named ANYTHING, but it's a common practice to have self documenting code including having names that are indicative of what the object represents. In this case, the CTE returns a limited set of rows from the INS4 table, hence the self-documenting name of INS4_LIMITED.
Drew
Thank you.
-Mark
MSSQL 2019 Standard, Azure Hosted. Techie/Sysadmin by trade; Three years as a "DBA" now.
July 25, 2018 at 1:02 pm
drew.allen - Tuesday, July 24, 2018 8:25 AMusererror - Tuesday, July 24, 2018 7:31 AMSteve,
This may be a silly question, but what is the significance of '_LIMITED' that you appended to the original table name "INS4" so it was 'INS4_LIMITED' on the subquery you made containing the WITH clause?
Thanks,
MarkINS4_LIMITED is the name he gave to the result set returned by the CTE so that he could reference later in the query. It could have been named ANYTHING, but it's a common practice to have self documenting code including having names that are indicative of what the object represents. In this case, the CTE returns a limited set of rows from the INS4 table, hence the self-documenting name of INS4_LIMITED.
Drew
Thanks for providing that perfect explanation of my code. I've been crazy busy at work for the last few days, so it's nice to know others can fill in the gaps this way.
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply