How to move Table varaible to Azure Data warehouse using Azure Data Factory

asked 2021-05-05T14:28:06.14+00:00
Sarvesh Pandey 141 Reputation points

We have a table name "@tablename" in SQL Server 2016. Using ADF, we are moving data from SQL Server to Azure DW but it throws a error - ErrorCode=InvalidTemplate, ErrorMessage=Unable to parse expression 'tablename': expected token 'LeftParenthesis' and actual 'EndOfData'."

Is there any way to move table variable through ADF?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
2,603 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
6,266 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. answered 2021-05-05T16:09:07.577+00:00
    Vaibhav Chaudhari 37,746 Reputation points

    There must be some code which is filling data in Table variable. You can try providing that select query in Copy activity source and load data to target.


    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    No comments

  2. answered 2021-05-11T19:10:33.19+00:00
    HimanshuSinha-msft 17,566 Reputation points Microsoft Employee

    Hello @Sarvesh Pandey ,
    I tried the below query and it just wroked fine . There is something else which is wrong in our case .

    DECLARE @rayn _TABLEVARIABLE TABLE
    (Name varchar(100)
    )
    INSERT INTO @rayn _TABLEVARIABLE values('Jon doe')
    SELECT Name from @rayn _TABLEVARIABLE

    95706-2021-05-11-12-05-45-analytics-moveandtransform-ver.png

    No comments