I need to store pictures (.jpg) in my table on MS SQL. What type of column I need to choose? If I always store three pictures, is there any array type in MS SQL to store in one column all three pictures ( like array in Oracle) ?
+1
A:
SQL Server 2008
supports FILESTREAM
: it's almost like a file pointer but is subject to transaction and access control.
SQL Server
does not support arrays. If you always store three images, why don't you create three fields for them?
Quassnoi
2010-10-28 15:04:14
A:
- You can use
varbinary(max)
to hold an image. It's controversial, but I find it makes my life easier: the images are part of each database backup or copy operation. (This is also an argument against this approach, especially if you have terabytes of images.)
As another poster points out, one of the new options for this datatype is FILESTREAM
. It looks good but I haven't had a chance to try it out myself.
- There's no array type in MS SQL.
egrunin
2010-10-28 15:04:25
`VARBINARY` uses `SQL Server`'s cache, `FILESTREAM` uses `NTFS` cache. Both are subject to backup.
Quassnoi
2010-10-28 15:14:10