How to Output SQL Query result into Sharepoint?

Babawale Dawodu 85 Reputation points

Hi all,

I have a stored procedure that converts binary data into pictures and outputs the JPEG files onto the disk drives. Unfortunately, there isn't enough space on the drives and I would like to utilize a web location like SharePoint or Azure.

Sharepoint is the first option at my disposal and I want to directly output these contents with or without a middleman (like PowerAutomate). How can I achieve this providing access/gateway issues are out of the way.

SQL Execution script is like this;

EXEC @return_value = [dbo].[ConvertImageFiles]

       @ImageFolderPath = N'E:\PictureExports

I changed the destination path to my SharePoint folder and nothing is happening

Any help guys? Thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,901 questions
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,870 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 102.3K Reputation points

    I guess this procedure uses xp_cmdshell + BCP for the export. Keep in mind that driver letters etc are those of the service account for SQL Server, not yours. And the service account is unlikely to have access to Sharepoint.

    Overall, I can't say that I am fond of solutions where you write to disk from SQL Server. It is much better in my opinion to use a client-side program for the task. That could be PowerShell, C# or whatever you like. This will save you from the limitations you are running into now.

0 additional answers

Sort by: Most helpful