cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Maxor
Regular Visitor

PAD - Execute SQL using a PAD DataTable against a TSQL stored procedure with a table parameter (TVP)?

Hello,

 

I running a power automate desktop flow. I'm trying to run the Execute SQL task (which I can do) against a SQL Server (version 2019) with a previous DataTable I grabbed from another task (in same flow) also from a SQL 2019 server. However, the stored procedure I'm trying to call has a table parameter. How (or can i) pass a DataTable in power automate to this TSQL procedure that has a TVP?

Example of procedure (on SQL 2019)

 

 

 

CREATE TABLE dbo.tbNames(
    ID   int IDENTITY (0,1) NOT NULL 
    Name varchar(50)        NOT NULL
)
GO
CREATE TYPE dbo.tNameEntry AS TABLE(
    Name varchar(50) NOT NULL
    PRIMARY KEY (Name)
)
GO
CREATE OR ALTER PROCEDURE dbo.InsertNames(
      @entries dbo.tNameEntry READONLY
)
AS
    INSERT INTO dbo.tbNames
        SELECT NAME FROM @entires
GO

 

 

 


I wanted to do in the Execute SQL command:
EXECUTE dbo.InsertNames %QueryResult%

This doesn't work. QueryResult is the result from a separate task in the same flow that was recieved from other SQL task against a SQL server 2019 database

1 REPLY 1
jgarry
Regular Visitor

would love to see this feature as well.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,501)