Answered by:
How to Store and view a Image in database using sql....?

Question
-
Hi...Sir/Madam
I Want to store the image in my database...
I gave a sql query to create a table
"Create Table EmployeeProfile ( EmpId int, EmpName varchar(50) not null, EmpPhoto varbinary(max) not null )"
After, creating the table.. I gave a insert query like this..
"Insert EmployeeProfile (EmpId, EmpName, EmpPhoto) Select 1001, 'Vadivel', BulkColumn from Openrowset( Bulk 'C:\Users\Public\Pictures\Sample Pictures\Koala.jpg', Single_Blob) as EmployeePicture"
Am getting the result...but am not able to view the image stored in database...
So Please Help me....
BaluJagua
- Changed type Kalman Toth Thursday, December 27, 2012 9:57 PM
Thursday, December 27, 2012 12:26 PM
Answers
-
hello,
you can use SSIS or SQL to accomplish this...Please se the below links http://www.sqlusa.com/bestpractices/imageimportexport/
You can also view it from the table,if you have ssms boost pulgin.. please see this thread http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/43c3741e-4c30-4aad-9b8e-23ebc4fde07d
Please mark as 'Answer', if the solution solves your problem.
- Proposed as answer by Fanny Liu Friday, December 28, 2012 1:38 AM
- Marked as answer by Allen Li - MSFT Wednesday, January 2, 2013 1:44 AM
Thursday, December 27, 2012 2:37 PM -
Am getting the result...but am not able to view the image stored in database...
You wont be able to view the image stored in the database column , it will be in binary format. You may have to use the front end application to view it.
Regards
Satheesh- Proposed as answer by Fanny Liu Friday, December 28, 2012 1:39 AM
- Marked as answer by Allen Li - MSFT Wednesday, January 2, 2013 1:45 AM
Thursday, December 27, 2012 2:45 PM
All replies
-
hello,
you can use SSIS or SQL to accomplish this...Please se the below links http://www.sqlusa.com/bestpractices/imageimportexport/
You can also view it from the table,if you have ssms boost pulgin.. please see this thread http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/43c3741e-4c30-4aad-9b8e-23ebc4fde07d
Please mark as 'Answer', if the solution solves your problem.
- Proposed as answer by Fanny Liu Friday, December 28, 2012 1:38 AM
- Marked as answer by Allen Li - MSFT Wednesday, January 2, 2013 1:44 AM
Thursday, December 27, 2012 2:37 PM -
Am getting the result...but am not able to view the image stored in database...
You wont be able to view the image stored in the database column , it will be in binary format. You may have to use the front end application to view it.
Regards
Satheesh- Proposed as answer by Fanny Liu Friday, December 28, 2012 1:39 AM
- Marked as answer by Allen Li - MSFT Wednesday, January 2, 2013 1:45 AM
Thursday, December 27, 2012 2:45 PM