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

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

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.
4,696 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,199 questions
0 comments No comments
{count} votes

2 answers

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

    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

    0 comments No comments

  2. HimanshuSinha-msft 19,386 Reputation points Microsoft Employee
    2021-05-11T19:10:33.19+00:00

    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

    0 comments No comments