Share via

Copy data Activity

Rohit Kulkarni 441 Reputation points
Mar 18, 2021, 4:53 PM

Hello Team,

I am running the script in query :

79247-image.png

Query :

@{pipeline().parameters.SelectClause}
from @{pipeline().parameters.Schema}.[@{pipeline().parameters.Companies[0]}$@{pipeline().parameters.TablesWithCompany[0]}]

@{pipeline().parameters.Companies[0] is in array
@{pipeline().parameters.TablesWithCompany[0]} is in array

I am getting error. Whether i am passing the parameter values wrong. Please advise

Failure happened on 'Source' side. ErrorCode=SqlOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=A database operation failed with the following error: 'Invalid object name 'pool.VendorsV2'.',Source=,''Type=System.Data.SqlClient.SqlException,Message=Invalid object name 'pool.VendorsV2'.,Source=.Net SqlClient Data Provider,SqlErrorNumber=208,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=208,State=1,Message=Invalid object name 'pool.VendorsV2'.,},],'

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,170 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
    Mar 19, 2021, 6:00 PM

    Hello @Rohit Kulkarni ,
    Thanks for the ask and using the Microsoft Q&A platform .

    As I understand the intention here is to get a query like

    Select a,b,c from dbo.company1TablesWithCompany1, if yes please try and use the expression

    @{pipeline().parameters.SelectClause}  
    from @{pipeline().parameters.Schema}.@{pipeline().parameters.Companies[0]}@{pipeline().parameters.TablesWithCompany[0]}  
    

    I also suggest that you use the set variable activity to test this kind of query , I have found that to be very helpful . The animation below will make my implementation clear and also how I am using the set variable activity .

    79710-333.gif

    Please do let me know how it goes .
    Thanks
    Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members


  2. HimanshuSinha-msft 19,476 Reputation points Microsoft Employee
    Mar 24, 2021, 4:19 AM

    Hello @Rohit Kulkarni ,

    Since you shared the query , I think it gave a little bit more idea of the issue . If you see there is space in between Group and O .

    try the below expressiona nd it should work .

    @{pipeline().parameters.SelectClause}
    from @{pipeline().parameters.Schema}.[@{pipeline().parameters.Companies[0]}$@{pipeline().parameters.TablesWithCompany[0]}]

    Output :

    {
    "name": "queryOutput",
    "value": "Select a,b,c\nfrom [dbo.Group O$Vendor]"
    }

    Please do let me know how it goes .
    Thanks
    Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.