Home > Ask the SQL Server Experts > Andrew Novick - Development Questions & Answers > Storing an image file in SQL Server
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Storing an image file in SQL Server

Andrew Novick EXPERT RESPONSE FROM: Andrew Novick

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Expert advice on database administration
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 30 August 2005
How do I store an image file in SQL? I'm trying to write a stored procedure that will automatically get a text file from a directory, and insert into a SQL table at a specific time of day. Can this be done?


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Andrew Novick - Development
Nullable fields in a table
Connecting Visual Basic to SQL Server
Stored procedures in Crystal Reports
Storing large amounts of data as ntext data type
Stored procedures looking at different databases
Code trigger that captures login and system date
Stored procedures and remote procedure calls
Using newid in SQL Server to insert records in parent-child tables
How to use results from one stored procedure in another
How to display the XML result of 'Select For XML Explicit'

SQL Server Stored Procedures
SQL Server Mailbag: CALs, witnesses and unwanted changes
SQL Server Mailbag: Stored procedures, triggers and SSRS reports
Top tips and tricks for SQL Server database development
Top 10 SQL Server development tips of 2008
SQL Server trigger vs. stored procedure to receive data notification
SQL Server errors, failures and other problems fixed from the trenches
SQL Server and data manipulation in T-SQL
How to use SQL Server 2008 hierarchyid data type
SQL Server stored procedures tutorial: Write, tune and get examples
Check SQL Server database and log file size with this stored procedure

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
library  (SearchSQLServer.com)
trigger  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


Yes, you can store image files in SQL Server. In fact, SQL Server has a datatype called image for exactly this purpose. It will store any binary data up to 2 GB in size.

There are many ways to get image files into your image column. Among the easiest is the Textcopy utility located in the Program FilesMicrosoft SQL ServerMSSQLBinn directory. Use the command "textcopy /?" to get the command line syntax for this utility.

Another way to get image files in and out of SQL Server is to write your own program using ADO or ADO.Net, or create an ActiveX dll that can be called by SQL Server's sp_OA* extended stored procedures.


Do you have comments on this Ask the Expert Q&A? Let us know.




Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SQL Solutions - SQL Database Design
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts