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

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

2 answers

Sort by: Most helpful
  1. Vaibhav Chaudhari 38,461 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

    0 comments No comments

  2. HimanshuSinha-msft 19,361 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 .

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


    0 comments No comments