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.
Solved! Go to Solution.
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.
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.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
31 | |
15 | |
13 | |
12 | |
7 |
User | Count |
---|---|
39 | |
24 | |
16 | |
10 | |
7 |