My team at work is tasked with pulling together cost analysis data from several SQL databases and exporting that data into a CSV format that we can give to the team that needs the data.
We have a stored procedure written that produces exactly the data that we want inside Management Studio. That stored procedure does include some calculations in order for the end data to be accurate. But we tripping up on getting the data table that we see in Management Studio as a result of our procedure, out to a CSV format.
We are thinking we may need to run a separate BCP process outside of the procedure in order to get the data exported out? But we aren't familiar enough to know if that's the solution, or how to navigate it.
Anyone have any guidance or tips with this?