Call Stored Procedure

Hello all,

I have app to export excel from SQL data with 2 Stored Procedure
image

For show: “sp_VIEW070_ShowData ‘%’,‘%’,‘%’,‘%’,‘%’,‘20220601’,‘20220731’,‘%’,‘V’,‘%’”
export: “sp_VIEW070_ExportExcel ‘%’,‘%’,‘%’,‘%’,‘%’,‘20220601’,‘20220731’,‘%’,‘V’,‘%’”

Now i want Run Query to run connect & export excel, no need open app. But have error

Hey!

Can you check manually in the server whether this is working fine or not?

And also can we create a string variable and pass the value to that variable…

Pass this variable in Run Query?

Regards,
NaNi

I checked in data SQL server it run ok
exec sp_VIEW070_ShowData ‘%’,‘%’,‘%’,‘%’,‘%’,‘20220601’,‘20220731’,‘%’,‘V’,‘%’

How I can do this

Hey!

Cool…

Can we try like this:

Assign StoredProcedures = "sp_VIEW070_ShowData ‘%’,‘%’,‘%’,‘%’,‘%’,‘20220601’,‘20220731’,‘%’,‘V’,‘%’"

Pass this variable to Run Query…

And also i need some more information

What exactly this query will do in the stored procedures?

Regards,
NaNi

1 Like

Still error, my Stored Procedure only sp_VIEW070_ShowData but when run need more information
sp_VIEW070_ShowData+‘%’,‘%’,‘%’,‘%’,‘%’,‘20220601’,‘20220731’,‘%’,‘V’,‘%’

sp_VIEW070_ShowData will query data


sp_VIEW070_ExportExcel will export excel

Hey!

I think we’re not using exec

Try this:

"exec sp_VIEW070_ShowData ‘%’,‘%’,‘%’,‘%’,‘%’,‘20220601’,‘20220731’,‘%’,‘V’,‘%’"

Try this and let me know

Regards,
NaNi

1 Like

Still error

Hey!

Have you selected the correct DBName in the Connect DataTable activity!

By defaultly this will takes the Master DB

If we stored the procedures other than Master DB… This will throw the error…

Could you please check in this case?

Regards,
NaNi

I test connection succeeded.

Cool…

The DataBase Name which we provided in the DataBase connection is correct?

Could you please clarify on this…

Regards,
NaNi

1 Like

Just for the record,

My database connection is working well since long ago. I have proper regular SQL queries working in the same UiPath Studio project.

However, there’s no way to get stored procedures working, no matter the approach, synthax, command type selection or whatever.