Solved

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

Posted on 2004-03-31
7
416 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
  • 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 25 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 25 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now