Answered by:
Download Images from SQL Table

Question
-
I am trying to download images stored in a table, as Photo (image, not null).
I will download to my local c:\temp\ folder.
Using the following
declare @path varchar(100)= 'c:\images\' SELECT [Photo],@path+[PhotoFileName] AS Path FROM [AIS_DEV].[dbo].[tblPhoto]
Getting this error.
Thanks,
jer
Friday, July 26, 2019 4:26 PM
Answers
-
Why do you need DECLARE at all here? In order to download image and display it you need to write small .NET program,
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 8:47 PM
Wednesday, July 31, 2019 9:36 AMAnswerer -
Here you go
Export images from a SQL Server Table to a Folder with SSIS
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
- Proposed as answer by Cathy JiMicrosoft contingent staff Monday, July 29, 2019 8:22 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 8:47 PM
Sunday, July 28, 2019 4:21 AMAnswerer
All replies
-
-
I am trying to create an SSIS package. Learning as I go.
jer
- Edited by jr7138 Friday, July 26, 2019 7:15 PM
Friday, July 26, 2019 6:00 PM -
Here you go
Export images from a SQL Server Table to a Folder with SSIS
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
- Proposed as answer by Cathy JiMicrosoft contingent staff Monday, July 29, 2019 8:22 AM
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 8:47 PM
Sunday, July 28, 2019 4:21 AMAnswerer -
Uri Dimant:
Thanks for that link, which is the guide I was trying to follow. But, thus my post because the Declare is my issue. Please see my screen shot and code.
Regards,
jer
Monday, July 29, 2019 2:13 PM -
-
Trying to download images files from a table. Using the job-aid Uri, mentioned, thus my post because the declare statement is having issues:
Here is the code they used, I just replaced with my table information and Photo field name:
declare @path varchar(100)= 'c:\images\' SELECT [ThumbNailPhoto] ,@path+[ThumbnailPhotoFileName] AS Path FROM [AdventureWorks2012].[Production].[ProductPhoto]
mine:
declare @path varchar(100)= 'c:\images\'
SELECT [Photo]
,@path+[PhotoFileName] AS Path
FROM [AIS_DEV].[dbo].[tblPhoto]jer
Monday, July 29, 2019 2:31 PM -
Anyone has more ideas?Wednesday, July 31, 2019 9:28 AM
-
Why do you need DECLARE at all here? In order to download image and display it you need to write small .NET program,
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
- Marked as answer by Ed Price - MSFTMicrosoft employee Thursday, August 8, 2019 8:47 PM
Wednesday, July 31, 2019 9:36 AMAnswerer