last day (15 days later) » 

4:57 PM
1
A: Can you set an xml node to a variable in SSIS?

Vladimir SemashkinIt depends on where you xml is. If it is in database then you can use the following code in Execute SQL Task. declare @xFull xml = ' <a> <b u="1"> <c d="asd"/> </b> </a> ' declare @node xml; select @node = n.query('.') from @xFull.nodes('/a/b') as f(n) select convert(varcha...

 
How do I execute the stored procedure? I tried using SQL Source Type -"direct input" and it is not letting me use the execute command.
 
I edit my answer, check it
 
Thank you that seemed to work. One last question. How would I setup the data type and value of the initial variable "v1"?
 
You can do it in Variables view. If I help you? accept my answer or up it. Thank you in advance.
 
So set the variable "v1" to string and leave the value blank?
Getting error when i set "exec Test @x" in the sql statement that says - "must declare scalar variable "@x"
 
4:57 PM
Oh, yes! I edit my answer one more time! Look at last picture and query they have been changed.
 
Getting closer, but I get an error: unable to parse EXEC Test @xml=?
 
You need to change parameter mapping
look at column "Parameter Name"
now there is '0' insted of real name of parameter
 
I did change it to '0' and it runs if I use "Exec Test", but not when I use "Exec Test @xml=?"
here is what I have for my sp: CREATE PROCEDURE Test AS
declare @xFull xml =
'
<FilterItems>
<FilterItem FilterItemId="62898" FieldTitle="Date Modified" Operator="GreaterThan" Value="" IsTemplate="true" />
<FilterItem FilterItemId="62899" FieldTitle="Date Modified" Operator="LessThan" Value="" IsTemplate="true" />
<FilterItem FilterItemId="62900" FieldTitle="Date Modified" Operator="GreaterThanOrEqualTo" Value="4/10/2015 12:00 AM" IsTemplate="false" />
<FilterItem FilterItemId="62901" FieldTitle="Status" Operator="DoesNotContain" Value="" IsTemplate="true" />
 
5:37 PM
I changed it to EXEC Test @xml = '?' and it's parsing correctly, but now it gives an error: [Execute SQL Task] Error: Executing the query "EXEC Test @xml = '?'" failed with the following error: "Procedure Test has no parameters and arguments were supplied.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
 
6:00 PM
Does Test have parameters ?
I you want give me your mail and I will send you my test project
 
my email is djcurtis2@gmail.com
 
6:17 PM
project was sent
 
6:33 PM
Also, I sent you sp test
Do you get it?
 
i did thanks!
still getting the error about the parameters. can i send you what i have?
 
7:22 PM
When I use the SP Test that you supplied I don't get the error, but something is going wrong when I pass the variable into the web method.
I have to be able to pass these values as an xmlNode into the web method. Please see service.leads360.com/ClientService.asmx?op=GetReportResults and service.leads360.com/Documentation/Examples/Client/…
I sent you my project
 
'can i send you what i have?" - sure, you can.
I gess I understand what happend...
Well... You need "GET data (node from sp)" or "get data and that use it like a parameter in sp for smth"?
in my project I get date with the script, than i use it like input parameter
If you need get data TO parameter from sp you need to call "exec test" in the first SQL Task and thats it
"TO parameter" - I mean to variable
 

last day (15 days later) »