Based on the architecture shown, how can data from DB1 be copied into TBL2?
Snowflake resolves unqualified objects in DML statements using the current database and schema. Therefore, a COPY command can either use SH1 as the current schema so that @STAGE1 and FF_PIPE_1 resolve to DB1.SH1 while explicitly naming DB1.SH2.TBL2, or use SH2 as the current schema for TBL2 and fully qualify the stage and file format as DB1.SH1.STAGE1 and DB1.SH1.FF_PIPE_1. COPY INTO <table> supports qualified target tables, named stages, and qualified named file formats.
SH1
@STAGE1
FF_PIPE_1
DB1.SH1
DB1.SH2.TBL2
SH2
TBL2
DB1.SH1.STAGE1
DB1.SH1.FF_PIPE_1
COPY INTO <table>
Community Discussion