• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

How can i insert an image ( or a big file) into sql server ?

I want to insert an image to test whether backing up the table data using bcp tool will also back up the data ( specially large size) stored in the bolbs is also come to the data file or not
0
d_kamal
Asked:
d_kamal
  • 3
2 Solutions
 
d_kamalAuthor Commented:
If I have to write a programme to insert the file into database then plz. give the ref. regarding to C#.
0
 
danblakeCommented:
Whether backing up the table data using bcp tool will also back up the data ---
You can use BCP to import / export the image, by creating a format file and selecting the image type.

Have a look here for a demo:
http://support.microsoft.com/default.aspx?scid=kb;en-us;197043

(This highlights a bug on SQL 7 that does not exist on SQL 2000 with one particular insert image type).

This also demonstrates that BCP does export the image files also.


Image perfomance in SQL Server is not as fast as storing the file outside the database.
0
 
raje10410Commented:
Hi Kamal,

For reading and writing BLOB data into a database by using ADO.NET with Visual C#.NET, you can have a look at the following KB article:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q309158

In VB, we can use GetChunk() and AppendChunk() methods to read and write BLOB data into a database.

Cheers,

Rajesh
0
 
danblakeCommented:
Here is an article with ADO.NET / C# on writing/reading blobs to/from the DB(SQL Server) System:

http://support.microsoft.com/default.aspx?kbid=317043


You may also be interested in : (.NET Framework Developer's Guide  
Obtaining BLOB Values from a Database)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconobtainingblobvaluesfromdatabase.asp

and a demo: (Read / Write BLOBs from / to SQL Server using C# .NET DataReader)
http://www.akadia.com/services/dotnet_read_write_blob.html
0
 
danblakeCommented:
Please not that BIG has a maximum limit of 2 GB.
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now