cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stelles3000
New Member

Execute SQL Statement: variable from two different server into a sql query

Hello everyone, I am facing a problem.

 

I have two sql connections (two different server). I execute one query in the first connection and save the data in a variable (%QueryResult%). In the second connection I do another query but I want to put data from the first connection %QueryResult% into my sql query, but the result is always nothing.

Select
*
From
Tabel1
Where
List in (%QueryResult%)

 

QueryResult = Datatable :

 

Name111

Name112

Name113

Name114

 

When I do it directly in MS SQL Server Management Studio i would usually type in 

 

Select
*
From
Tabel1
Where
List in 

('Name111',

'Name112',

'Name113',

'Name114')



Do some have a solution?

1 REPLY 1
Gene_Liang
Regular Visitor

Hi, I think the issue you faced was the conversion between variable types, can you click on the %QueryResult% in variable pane while the process was executed and post the screen capture so I can help you sort things out ?

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,653)