Click here to Skip to main content
12,445,916 members (74,308 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
It is Good to Store Video in Binary Format in sql server?

i used this for image and mp3 both working fine.

But when using Video then i'm able to store video but i'm unable to play
Posted 16-Jan-13 1:59am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You can store video in SQL server, but I would strongly advise against it.
There are a couple of reasons for this:

1) The total size of a database is limited (how much so depends on the version of SQL server you are using) and video is generally pretty big: running around 500MB per hour, or more for hi res it doesn't take many videos to fill a DB to capacity.
2) When you store video in SQL you have to retrieve it from SQL - and that means that it uses the SQL Server Instance bandwidth at a phenomenal rate - it can seriously slow down other users (and your code, since SQL doesn't have any concept of "streaming" data and returns it as a monolithic object)

For these reasons, I would store the video in a file, and store the address of that file in SQL. (I also recommend this for images where the image is bigger than thumbnail size, say 100x100 pixels)
  Permalink  
Comments
Surendra0x2 16-Jan-13 8:22am
   
Thanks Sir,and can u clear my doubt what about mp3 files it would be good if i store mp3 using varbinary(max) format or just store song'name and retrieve.
and for image what if image is between 1 MB to 5MB then it would be good to store as image datatype and retrieve?
OriginalGriff 16-Jan-13 9:30am
   
MP3 is on the borderline - it would depend on the traffic levels to an extend - given that are the same size (pretty much) as images @ 1~5MB, but MP3's tend not to be retrieved as quickly - a user can only listen to one of them at a time, and probably won't expect a new one every 5 seconds! :laugh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 16 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100