Solved

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

Posted on 2004-03-31
7
454 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Display SQL maintenance plan SQL Code 3 47
Does INTERSECT return opposite from FULL OUTER JOIN? 4 40
SQL Query 9 27
database audit for object access 6 42
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

734 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