web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to check if there'...
Power Automate
Unanswered

How to check if there's an item at Sql Server Table

(0) ShareShare
ReportReport
Posted on by 220

Hi guys!

 

I'm importing an XML file that has a code.

I need to find at a SQL Server table if this code exist or not, if exist, do nothing, if do not exist, insert.

I made a SQL query to count if this code exist, but, when do not exist, I can't made any solution do continue the flow.

Has someone that made some solution like this?

 

Thank you,

Robson.

Categories:
I have the same question (0)
  • Verified answer
    Barret Profile Picture
    652 Most Valuable Professional on at

    I would do this all in a single SQL statement. Something to the effect of:

     

    IF NOT EXISTS (SELECT TOP 1 * FROM TABLENAME WHERE CODE = 'CODE')

    INSERT INTO TABLENAME VALUES ('CODE')

     

    No need to have multiple steps do anything else.

  • rgparisoto Profile Picture
    220 on at

    Thank you @barret !

    I'll test.

    Regards,

    Robson.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard