I'm not sure if this can be done, but is there a way to use a table alias for the duration of a stored proc, including sub procedures?
For example if you wanted to have an alias Customers that could refer to either the DailyCustomers table or the MonthlyCustomers table, perhaps set by a flag? Pre-empting the obvious point that a Customers could contain both with a flag set - in this case there are very good reasons (due to data feeds basically) that this is not possible here and cannot be used in this case, which I don't want to go into here 😉
I think I'm right in saying a CTE wouldn't have scope in sub procedures?
Thanks in advance.
July 19, 2023 at 11:45 am
Thanks Phil, perfect, I knew there was something but couldn't remember the name, not having used it before 😊
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply