Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 How do i store videos on sql server 2008?

Author  Topic 

makubex1719
Starting Member

6 Posts

Posted - 2010-07-27 : 23:44:17
Hi everybody!!

I was wondering if there is someone that can help me!! I'd like to know how I can make a program like Youtube but on ASP.NET connected to SQL 2008 what I mean is that I don't know How to store videos on the database...

I've hear that one way is to make a method to convert the video to byte but I'm still a noob so I don't how to do it!!

I'll be much pleasured to know if there is an answer to my problem

Thanks a lot!!

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-07-28 : 10:55:43
SQL Server is, in my opinion, the wrong place to store them.

But, to answer your question use Varbinary(MAX) data type
Go to Top of Page

makubex1719
Starting Member

6 Posts

Posted - 2010-07-28 : 13:27:59
quote:
Originally posted by russell

SQL Server is, in my opinion, the wrong place to store them.

But, to answer your question use Varbinary(MAX) data type


Why do you think sql server is the wrong place?

Can you tell more about it because i don't want to commit a mistake

Thanks... I hope Your answer
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-07-28 : 14:22:55
I'll store them on a file server and keep the path to them in the database
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-07-28 : 14:44:57
quote:

We know you're used to sixteen or more
Sorry we only have eight



http://www.steelydan.com/lyrkaty.html#track6



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-29 : 02:18:38
"Why do you think sql server is the wrong place? "
  • Potential lack of caching
  • Throughput
  • Scalability
  • Having to backup all the videos with your SQL data


The ONLY reason (IMHO) to include Images / other large objects in the database is if:
  • They MUST be tied ATOMically to some data - either the Image AND its meta data are in the database, or NEITHER is
  • There is a need to bundle Images and Data together - e.g. to distribute the whole lot as one entity without users orphan data being created
  • There is a security issue - only certain people can see Image-1 - and SQL Database solves that somehow that the file system does not.


For anything else:

Store the meta data about the Image (include path filename) in the database, and put the Image on the filesystem
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2010-07-29 : 03:55:27
You could use the new FILESTREAM feature in SQL Server 2008.

I have not used this yet - so can't personally comment on the above concerns.
There is a useful write-up here: http://www.sqlskills.com/BLOGS/PAUL/post/SQL-Server-2008-FILESTREAM.aspx
Go to Top of Page

makubex1719
Starting Member

6 Posts

Posted - 2010-07-29 : 23:51:26
Thanks for all the answer to everybody!! But I still want to know What will be the perfect "CODE LINE" to put on my syntaxis of ASP.NET
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-07-30 : 08:56:44
First, you need to Enable it

http://technet.microsoft.com/en-us/library/cc645923.aspx

Then, you can use it

http://technet.microsoft.com/en-us/library/bb933993.aspx

I plan to play with this today

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-07-30 : 08:58:23
[code]
CREATE TABLE Archive.dbo.Records
(
[Id] [uniqueidentifier] ROWGUIDCOL NOT NULL UNIQUE,
[SerialNumber] INTEGER UNIQUE,
[Chart] VARBINARY(MAX) FILESTREAM NULL
)
GO


[/code]


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-07-30 : 09:04:31
Wow...here's a great article

http://www.simple-talk.com/sql/learn-sql-server/an-introduction-to-sql-server-filestream/

Is Jacob a member of SQL team???



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2010-07-30 : 11:24:27
I believe that SharePoint 2010 uses this feature with SQL Server 2008 via Remote BLOB Store Provider Library. Lots of discussion about this on the links below.


http://blogs.msdn.com/b/opal/archive/2009/12/07/sharepoint-2010-beta-with-filestream-rbs-provider.aspx
http://technet.microsoft.com/en-us/library/ee748649.aspx
http://technet.microsoft.com/en-us/library/cc905212(SQL.100).aspx
http://msdn.microsoft.com/en-us/library/cc949109.aspx
http://technet.microsoft.com/en-us/library/ee748631.aspx
http://technet.microsoft.com/en-us/library/ee748641.aspx





CODO ERGO SUM
Go to Top of Page

makubex1719
Starting Member

6 Posts

Posted - 2010-07-30 : 19:17:44
So If I do this on my sql server 2008:

create table demo(
cod int not null primary key,
name varchar(100),
picture image
)

That's wrong ??

Because everybody talk about "FILESTREAM" and to be honest with You I haven't ever used that kind of data type.

To conclude, I must change Image by filestream or no?

Thanks again, I hope Their answers!!
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-07-30 : 20:02:55
The image data type is deprecated and will be removed. Varbinary(max) is the preferred data type to use for storing videos and other streaming data. FILESTREAM is the preferred method for streaming data, for reasons given in the articles linked above. You should read them all thoroughly and understand the benefits and downsides so you can choose the best way to deliver this data to your users.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-31 : 02:10:51
Or just put the Video files on your web server and store the path / filename in the database ...
Go to Top of Page

makubex1719
Starting Member

6 Posts

Posted - 2010-07-31 : 20:53:37
quote:
Originally posted by robvolk

The image data type is deprecated and will be removed. Varbinary(max) is the preferred data type to use for storing videos and other streaming data. FILESTREAM is the preferred method for streaming data, for reasons given in the articles linked above. You should read them all thoroughly and understand the benefits and downsides so you can choose the best way to deliver this data to your users.



Well, I'm gonna read more about the topic thanks
Go to Top of Page

makubex1719
Starting Member

6 Posts

Posted - 2010-07-31 : 20:55:55
quote:
Originally posted by Kristen

Or just put the Video files on your web server and store the path / filename in the database ...


That will be the easier way!! I also thought about that posibility but I wanted to know what I posted first.

Thanks anyway!!
Go to Top of Page
   

- Advertisement -