79719463

Date: 2025-07-30 05:16:58
Score: 1.5
Natty:
Report link

If renaming via SQL is mandatory and you're okay going through a table:

  1. Load the file into a temporary table.

  2. Use COPY INTO @targetstage/newfilename.csv to export.

  3. -- Step 1: Load to table

    COPY INTO my_temp_table FROM @inputstage;

    -- Step 2: Export with desired filename

    COPY INTO @targetstage/newfilename.csv FROM my_temp_table FILE_FORMAT = (TYPE = CSV);

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @inputstage
  • Low reputation (1):
Posted by: Aditya Kashyap