 |
| SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 14th, 2004, 03:18 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Since when is an image not data? ;)
|
|

January 14th, 2004, 03:27 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ha - you caught me...but you know what I mean...
_________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice (360) 902-5928 fax (360) 902-6200
|
|

January 14th, 2004, 04:02 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by hortoristic
... There were many sources and destinations for the images so the file path was the best option.
|
if the same image must be referenced in multiple places, you can build a special table for the images. each image would have an id, and you store this id in the tables that reference the image. foreign keys will enforce that an image won't be deleted when it is referenced by a record in another table. when using the filesystem approach, this is not possible.
Quote:
|
quote:IIS security worked well enough for our needs as well as our custom security model we had in place for the web.
|
if you store the image in the db, all the security you need to base on, is the sql server's security, and not iis's, or a custom security model.
Quote:
|
quote:The reiterate - another main reason was the DB would get get huge.
|
the size of the db with the images inside will be pretty much the same as the size of the db without the images and with the total size of the image files. so, in the end, the size is the same.
Quote:
|
quote:DB's are written to handle data well - not images.
|
have you done any tests to prove this?
Quote:
quote:_________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice (360) 902-5928 fax (360) 902-6200
|
defiant.
|
|

January 14th, 2004, 04:09 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Quote:
quote:
the size of the db with the images inside will be pretty much the same as the size of the db without the images and with the total size of the image files. so, in the end, the size is the same.
|
Sure, you'll consume more or less the same number of bits on disk, but the performance of access to the rest of the data in the database will be adversely affected by the bloat the images cause.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
|
|

January 15th, 2004, 04:54 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
The main advantage we have found to storing images inside the database is that it makes everything more portable. It's easier to move a database lock, stock and barrel than have to worry about which files need moving as well. This also helps in replication. Otherwise I nearly always choose storing the path, it's so much easier when you need an image for a web page.
--
Joe
|
|

January 15th, 2004, 07:16 AM
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
first of all you need the type field is Image and u can save an image in it with the help of ADO Streem object ( need refrence of ms ado liabrary 6)
Dim rs As New ADODB.Recordset
Dim st As New ADODB.Stream
Dim str As String
str = Txt_PicturePath
st.Type = adTypeBinary
st.Open
st.LoadFromFile str
rs.open "make connection with your table"
rs.AddNew
rs.Fields("imagefield").Value = st.Read
rs.Update
st.Close
rs.Close
|
|

January 19th, 2004, 01:45 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by Jeff Mason
Sure, you'll consume more or less the same number of bits on disk, but the performance of access to the rest of the data in the database will be adversely affected by the bloat the images cause.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
|
the images will be present in the other case too. the images won't be stored on the same data pages as the non-blob data o the row ( afaik) unless a special option is set. so i see no real difference in performance. you can also configure a special database file for all the blobs, and so they will be clearly separated from the rest of the data.
Microsoft TerraServer stores the images inside the database, and they recommend that for most of the cases (i foud out this while quickly browsing the article). Nice article here:
http://www.microsoft.com/technet/tre...art3/c1161.asp
Of course, one could argue that this article is done by microsoft, who is the vendor of the product...
defiant.
|
|

January 19th, 2004, 05:33 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I'm aware of how BLOBs are stored. The article was interesting in that regard, though I use 'Inside SQL Server 2000' as my SQL Server internals bible, so the article didn't really present anything new.
I really don't want to argue with you about this - you should do whatever you think is appropriate for your situation. My experience was that storing images in the database was more trouble than it was worth and we saw a definite performance impact on the database as a whole. I note that TerraServer is a database containing virtually nothing but images. The systems I have worked with were oriented towards other more "traditional" forms of data, with images as merely an adjunct (e.g. employee pictures). In those sorts of systems we found it better to store the images outside the database. We found them easier to manage and maintain that way.
This seems to be a clear case of YMMV; I reported my experiences and recommendations, and if yours differ, more power to you.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
|
|

December 17th, 2007, 06:11 AM
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi jeff
can you send me the coding for how to insert image path in sqlserver and how to retrive image in the datagridview using c#
|
|
 |