I have the following code in a very long stored procedure, where P equals the Products table:
SELECT
P.*,
etc1,
etc2
Which would give me “ProductID” and so on.
I would like to select it with a prefix such as:
SELECT
P.* AS P_*,
etc1,
etc2
Which would give me “P_ProductID” and so on.
Is this possible to do?
Not unless you use dynamic SQL. It is very uncommon to require such a thing though, are you sure you need it?
Working example
Output: