?
Solved

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

Posted on 2004-03-31
7
Medium Priority
?
468 Views
Last Modified: 2012-08-13
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
Comment
Question by:d_kamal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 

Author Comment

by:d_kamal
ID: 10721934
If I have to write a programme to insert the file into database then plz. give the ref. regarding to C#.
0
 
LVL 13

Expert Comment

by:danblake
ID: 10722034
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
 
LVL 1

Accepted Solution

by:
raje10410 earned 100 total points
ID: 10722568
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
 
LVL 13

Assisted Solution

by:danblake
danblake earned 100 total points
ID: 10723255
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
 
LVL 13

Expert Comment

by:danblake
ID: 11026509
Please not that BIG has a maximum limit of 2 GB.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question