Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Storing Tiff files

Author  Topic 

Dinky
Starting Member

37 Posts

Posted - 2007-10-10 : 16:14:56
What is the best way to store 100 of thousands of .jiff files (<5 MB each) to be used (creating and retreiving) in .net c# new application using sqlserver db.

We will also need to migrate existing files working with old VB application to .net c# application


So the next question will be to: what is the best way to migrate these files into new db/system

Please advice.
Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-10-10 : 16:17:18
It is not recommended to store the images directly in the database.

Store the images on the application server. Then store the path to the images in the database.



Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-10 : 16:23:59
See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Images,Image

Kristen
Go to Top of Page

Dinky
Starting Member

37 Posts

Posted - 2007-10-10 : 16:24:47
<Then store the path to the images in the database>

Thanks Tara. How do we store path of files in sqlserver database. How big those entries/data field will be?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-10-10 : 16:28:49
I'm not sure I understand what you are looking for when you ask how to do it. But you would use an INSERT statement and provide the location of the file. I'd probably stored partial paths and have the application server know the first part of it in say an app.config. That way you can easily move directories around and not have to update the database. Such as:

On the app server, I'd store the files on a SAN drive and store the path in a config file. Perhaps F:\Images.

Then in the database, I'd store:
\Project1\File1.jpg

So in your application code, you'd combine the app server's config with the database data: F:\Images\Project1\File1.jpg

But that's just me. However you do it, make sure not to store the image in the database, just the path.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -