Hi
I have a table of people, and for some of them I want to store photo's, is it better to store the phots in a separate table or just add a column to the people table? I'm think about 60% will have photo's.
What is the best way to add a photo to a table?
Hi Graham,
The best practice is to create the image column in a seperate table and have a link column in the primary table.However the design is based on the retrieval of the table data,If your people data is always retrieved with image and no where else it is used in join with other tables it can be part of your main table itself
Regards,
Samsudeen B
|||First why you want to store those Photos in Database. Consider to strore those on file system and store the File path on your table. It is very cheap to store on the filesystem(memory, retrival, storage & manipulations)..
If you want to store the Photos in database you need to store those in different table as Master Table. You can have those refrences on the detailed table. It is not a bad idea to keep the Image properties on the same (where the photos stored) table, like photo name, photo file ext, photo size etc..
|||Thank you, I had considered storing the filepaths (presumably nvarchar(260) is the best), but I thought the reason image type existed was because it was better to store images within the database, and I thought it might be more secure. But I can easliy fix security.|||I know lot of people misunderstand with the name. Image is one of the Binary datatype and you can store any binary data like Word Docs, Excel and other binary files (image too). In Sql Server VarBinary(Max) is introduced.
|||What's the advantage of storing other document types, rather than storing file paths?
Is it a security issue? Surely file permissons can fix that, or is it to do with replication, and distributed databases (not an issue for my needs)?
No comments:
Post a Comment