admin管理员组文章数量:1318564
My copy activity is attempting query on two tables in a database called OSCAR. One of the tables 'toMasterPolicy' in the database uses the schema dlt, whereas the table with the same 'toMasterPolicy' uses the schema dbo.
When I execute the following query below, I get the error:
Clearly the problem is that I'm using the same name for each table. In a previous question I asked if I could add suffix to a 'TableName' to change the name of the table. It was suggested I could do the following:
@concat(pipeline().parameters.TableName,'V2')
Can someone take a look at my expression and either help me modify the expression to add a suffix as suggested i.e. @concat(pipeline().parameters.TableName,'V2')
Or show me how to use as correlation name to distinguish the tables 'toMasterPolicy'
My expression is as follows:
@
concat('SELECT ',pipeline().parameters.TableName,'.* FROM ',pipeline().parameters.tempdb,'.',pipeline().parameters.deltaschema,'.',pipeline().parameters.TableName,' LEFT OUTER JOIN ',pipeline().parameters.tempdb,'.',pipeline().parameters.Domain,'.',pipeline().parameters.TableName,' ON ',pipeline().parameters.TableName,'.signature = ',pipeline().parameters.TableName,'.signature WHERE ',pipeline().parameters.TableName,'.signature IS NULL')
My copy activity is attempting query on two tables in a database called OSCAR. One of the tables 'toMasterPolicy' in the database uses the schema dlt, whereas the table with the same 'toMasterPolicy' uses the schema dbo.
When I execute the following query below, I get the error:
Clearly the problem is that I'm using the same name for each table. In a previous question I asked if I could add suffix to a 'TableName' to change the name of the table. It was suggested I could do the following:
@concat(pipeline().parameters.TableName,'V2')
Can someone take a look at my expression and either help me modify the expression to add a suffix as suggested i.e. @concat(pipeline().parameters.TableName,'V2')
Or show me how to use as correlation name to distinguish the tables 'toMasterPolicy'
My expression is as follows:
@
Share Improve this question asked Jan 21 at 10:32 PattersonPatterson 2,8298 gold badges57 silver badges147 bronze badges 3concat('SELECT ',pipeline().parameters.TableName,'.* FROM ',pipeline().parameters.tempdb,'.',pipeline().parameters.deltaschema,'.',pipeline().parameters.TableName,' LEFT OUTER JOIN ',pipeline().parameters.tempdb,'.',pipeline().parameters.Domain,'.',pipeline().parameters.TableName,' ON ',pipeline().parameters.TableName,'.signature = ',pipeline().parameters.TableName,'.signature WHERE ',pipeline().parameters.TableName,'.signature IS NULL')
- Waht is source and sink – Pratik Lad Commented Jan 21 at 10:54
- Hi @PratikLad, thanks for getting in touch. The source is dbo.toMasterPolicy and the sink is ADLS. However, please bear in the mind the expression is executed on the source database and the results of the expression is simply sent to ADLS. The main issue here is that expression used someway of handling tables with the same name. I hope I'm making sense – Patterson Commented Jan 21 at 11:17
- So, I guess what I'm saying the sink isn't the issue. Its the expression that I'm having a problem with – Patterson Commented Jan 21 at 11:18
1 Answer
Reset to default 0The objects "OSCAR.dbo.toMasterPolicy" and "OSCAR.dlt.toMasterPolicy" in the FROM clause have the same exposed names. Use correlation names to distinguish them.
The above error you are getting is the table name you are using the above query has same table to resolve this issue you need to use aliases for each reference to toMasterPolicy
Your query should look as below:
SELECT sampletable.* FROM sampletempdb.dlt.sampletable as dlttb LEFT OUTER JOIN sampletempdb.dbo.sampletable as dbotb ON dlttb.signature = dbotb.signature WHERE dlttb.signature IS NULL"
As per above your dynamic expression will look like below:
@concat('SELECT ',pipeline().parameters.TableName,'.* FROM ',pipeline().parameters.tempdb,'.',pipeline().parameters.deltaschema,'.',pipeline().parameters.TableName,'as dlttb LEFT OUTER JOIN ',pipeline().parameters.tempdb,'.',pipeline().parameters.Domain,'.',pipeline().parameters.TableName,' as dbotb ON dlttb.signature = dbotb.signature WHERE dlttb.signature IS NULL')
本文标签:
版权声明:本文标题:Azure Data Factory Error: Objects In From clause have the same exposed names: Use correlation names to distinguish them - Stack 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742049714a2418001.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论