Reputation: 6489
I want to save a stream video into my database, I want to know what data type in SQL-Server is suitable to save video stream ?
EDIT : Note that, I'm using EF4 as my project ORM.
Any advice will be graceful.
Thanks.
Upvotes: 1
Views: 2985
Reputation: 160922
For storing BLOBs such as video data you can use the varbinary(MAX)
data type in SQL Server 2005 which is supported by Entity Framework.
Keep in mind whenever you load the entity that contains this column EF will try to fully load your full video into memory, there is no byte streaming mode in EF - this means not only will this not scale well but with multiple users also becomes infeasible because of the memory requirements and will perform poorly. Don't do this - I would look hard for better alternatives.
Upvotes: 1
Reputation: 294307
Download and Upload images from SQL Server via ASP.Net MVC. The article shows how to use streaming semantics for large BLOBs (avoid creating an in memory byte[]) and you ca use the implementation in C# forms just as well, is nothing specific for ASP MVC or web in general.
Upvotes: 1
Reputation: 44605
we can assume that a video is basically a file and you can use the FILESTREAM
SQL 2008 data type.
there should be plenty of examples around, I found this:
Upvotes: 1