Question:
How to add pictures and videos on Sql server?
Shabbir M
2014-09-08 11:47:10 UTC
Ihave made a form and I hve connected with my db but I dnt knw how to create a picture and video column in sql server 2012

Whats the code to save that?i mean what data type?

A short demo would really help..thanks
Five answers:
Aaron Vigal
2014-09-08 16:09:42 UTC
I would not store actual 'pictures' on a sql server. Just add the image path and echo it out using php in an html ing tag.
Kevin
2014-09-08 12:07:22 UTC
To save image and video file in an SQL server you will need to use the BLOB data type http://msdn.microsoft.com/en-us/library/0t1k839z(v=vs.80).aspx



You will need to convert the file to binary data and save the data in the database. To reopen them, read the binary data back then convert the binary stream into the appropriate file type. Exactly how to do this depends on the programming language you are using as Jeff P indicates.



Doing this is considered bad practice however, as the size of these files will eventually affect database performance. A better approach is to save the file on the disk, and store the file path in the database.
2014-09-08 12:01:33 UTC
Go to this link for add pictures on Sql server



https://www.youtube.com/watch?v=BqyAAGMfTD8
Jeff P
2014-09-08 11:59:10 UTC
SQL Server doesn't have a "picture" or "video" data type. You should look into the Filestream feature. How you would go about doing this depends entirely on whatever programming language you built your form/application in.
?
2014-09-08 11:51:55 UTC
try youtube


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...