Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Delete rows from MSSql table based on values in tMap row output?

I need to delete rows from an MSSql table where their primary key values match the values in a tMap's row output column of values.
I'm trying a tMSSql Row component, loaded with the schema of the table (Providers). It's input is a row output (NPIsToBeDeleted) of a tMap that has a single column (BadNPIs).
I'm trying this query:
"DELETE FROM Providers
WHERE NPIsToBeDeleted.BadNPIs = Providers.PrimaryNPI"
It compiles OK, but I get a runtime error:
The multi-part identifier "NPIsToBeDeleted.BadNPIs" could not be bound (repeated a lot of times).
What have I got wrong?
Is there a better method?
0683p000009MDnT.jpg 0683p000009MDyj.jpg
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Got it.
But had to figure out how to reference the global variable in the query string:
"DELETE FROM Providers
WHERE Providers.PrimaryNPI = " + globalVariable

View solution in original post

3 Replies
Anonymous
Not applicable
Author

You got that error because your tmap producing more than one value which is not handle by sql row component.
so do one thing after tmap put --tFlowToIterate-- and after that get global variable form tflowtoiterate "PrimaryNPI" column value to delete the rows..
Hope this solve your problem..
Anonymous
Not applicable
Author

Got it.
But had to figure out how to reference the global variable in the query string:
"DELETE FROM Providers
WHERE Providers.PrimaryNPI = " + globalVariable
alevy
Specialist
Specialist

Why are you not just using tMSSqlOutput to delete the records?