5 Replies - 1479 Views - Last Post: 14 September 2016 - 11:20 PM

#1 Adqusit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 176
  • Joined: 02-March 13

What datatype is used for storing images and videos in sql server 2008

Posted 25 August 2016 - 08:20 PM

HI. I am having a table where I have to store the images and videos of Doctors Patients in database. In SQL SERVER 2008 I found image datatype but no datatype i found with the name of video.

1. What dataType i use for both of them?

2. I also googled, it is written that using an image or video directly in database is not a good practice, instead store them on hard drive and just get the path in the database like file address etc. So If have to store only file path so do I need to use varchar(100) or another dataType for both image and video file paths?

Please guide me with detail


Thank you for guidance.

Is This A Good Question/Topic? 0
  • +

Replies To: What datatype is used for storing images and videos in sql server 2008

#2 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2343
  • View blog
  • Posts: 9,398
  • Joined: 03-December 12

Re: What datatype is used for storing images and videos in sql server 2008

Posted 25 August 2016 - 08:39 PM

It is bad practice to store binary in the database, because of the ease in screwing it up.

Going the file path route, it would be a varchar for as large as the expected path would be, including the filename.
Was This Post Helpful? 0
  • +
  • -

#3 Adqusit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 176
  • Joined: 02-March 13

Re: What datatype is used for storing images and videos in sql server 2008

Posted 25 August 2016 - 08:43 PM

Ok. Then when i will select varchar so how much size I would give it in parenthesis for varchar (max size)?

And normally in what folder I shall store the images and videos?

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 446
  • View blog
  • Posts: 2,179
  • Joined: 07-April 08

Re: What datatype is used for storing images and videos in sql server 2008

Posted 26 August 2016 - 07:12 AM

Where you store the images/videos is totally up to you. Some people have a dedicated SAN, some people have a directory in their application, while others allow the user to select where to store the information. As for max varchar size, that is also up to you. I would honestly set it at 260 as that is the MAX_LENGTH for windows path, but if you are running the application on another system, you could allow for larger paths.
Was This Post Helpful? 0
  • +
  • -

#5 Adqusit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 176
  • Joined: 02-March 13

Re: What datatype is used for storing images and videos in sql server 2008

Posted 26 August 2016 - 09:19 PM

Thanks Firefly,

its really helping.


I asked this question because I was planning to store the file into D Partition or E partition but many people have only C partition in their PC or laptop. SO I am thinking to put it in My Documents folder or in installed folder.
Was This Post Helpful? 0
  • +
  • -

#6 Adqusit  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 176
  • Joined: 02-March 13

Re: What datatype is used for storing images and videos in sql server 2008

Posted 14 September 2016 - 11:20 PM

Thank you for participating into my thread.

Thanks.

How to mark this thread as Resolved?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1