[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2004-03-31
7
Medium Priority
?
475 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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.

656 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