views:

788

answers:

5

What datatype would be used for storing video files in sql server2000?

+3  A: 

Use BLOBs (binary large objects). Documentation here. More specifially:

In SQL Server, BLOBs can be text, ntext, or image data type

image

Variable-length binary data from 0 through 231 - 1 (2,147,483,647) bytes.

Tuminoid
Voting a correct answer to the question down because the way asker is doing things is WRONG, especially without even leaving a comment. There may be a (stupid) requirement why he is doing it, and maybe the files are small (mobile videos for example). Voting down correct answer for it is just STUPID.
Tuminoid
I aggree tuminoid +1 for right answer to a silly question
JoshBerke
+1 for your discussion on this question ;)
devio
I understand your point but I think giving answers should be about providing the best solution. Storing a BLOB in SQL Server 2000 is not the best solution to storing files IMHO even though as you correctly state; for this specific question it is the correct answer.
Espen
A: 

Save yourself a headache and store them on the file system. Store the path in the DB.

Currently I can't think of a really good reason to store videos in a database, when there is a file system available. What are your's?

Tomalak
I can. It seems like a very cheap way to get replication and integrity services. Educating programmers on how to implement replication and integrity will make it easier for them to see the cost of using SQL for everything...
geocar
+5  A: 

In most cases, a database isn't the ideal place for video. You can force it (varbinary(max), or image on older versions), but if you do this, you'll need to be very careful to use steraming access rather than "get all" access (if you see what I mean). And you'd probably want the video on a different file-group (and probably drive) than regular data.

In SQL Server 2008 there is the filestream type, which is a hybrid between db and file system. Maybe this will do what you need?

If not, just use the file system.

One other reason not to use video in the DB; if you have a small system, SQL Server Express might be ideal - but has a db size cap that video will quickly swamp.

Marc Gravell
SQL SErver EXpress has a 4GB data file limit
Mitch Wheat
Yes... read the last line of the post!
Marc Gravell
+1  A: 

In SQL Server 2000 BLOB support is not good enough and you should definitively store files directly on disk. In SQL Server 2008 support for storing files in the database is supposed to be a lot better. I have never tried it as we had already built our application to store files on disk. But I think I would still recommend to store files on disk as it provides more flexibility in terms of storage; you can easily back it up and move files around. Also it reduces the size of the database which likely will make it faster.

So store the path in your database and the actual files in the file system.

Espen
+1  A: 

I agree with Tomalak, even pictures and other smaller assets are much better served outside of the database. Our products use only reference paths to the assets in the DB, with th DB serving as a dictionary to location.

Of course the one down side is the disconnect that can develop between the filesystem and the DB entries, so you need to pay special attention to how you set this up and maintain it in an ongoing fashion.

Bill