locked
how to store songs in database ? RRS feed

  • Question

  • i don't know how to store the music and video file in database . please help me.
    Wednesday, January 25, 2012 9:20 PM

Answers

  • Hi Durlove_roy,

    You can use BLOBs (Binary Large Objects)  to store such as  images and sounds files in SQL Server. Legacy data types used in SQL Server versions 2000 and SQL 2005 will be examined as well as the new SQL 2008 FILESTREAM binary type. In SQL 2008 the data type you can use VarBianry(max), which is Variable size and no maximum limit.

    But Rather than Keeping Audio file inside database Better keep on Hard Disk and path in database.
    There are some related threads please have a look:
    1. http://stackoverflow.com/questions/3458201/how-to-read-and-write-mp3-to-database
    2. http://codesupport.wordpress.com/2011/03/01/mp3/

    For more information, please refer to this Blog about how to store BLOBs in SQL SERVER.
    Regards, Amber zhang
    • Marked as answer by amber zhang Wednesday, February 1, 2012 6:47 AM
    Friday, January 27, 2012 6:15 AM

All replies

  • One option could be using OPENROWSET http://msdn.microsoft.com/en-us/library/ms190312.aspx

    Try some of the examples in the link. 

    Wednesday, January 25, 2012 9:30 PM
  • If you're using SQL Server 2008, search for the new FILESTREAM datatype for storing media contents (that has good transactional consistancy). If you're using other versions you can store the media files in binary format in VARBINARY(MAX) or IMAGE datatypes.

    - Krishnakumar S

    Wednesday, January 25, 2012 9:33 PM
  • i will use SQL Server 2008.
    Wednesday, January 25, 2012 9:35 PM
  • Hi Durlove_roy,

    You can use BLOBs (Binary Large Objects)  to store such as  images and sounds files in SQL Server. Legacy data types used in SQL Server versions 2000 and SQL 2005 will be examined as well as the new SQL 2008 FILESTREAM binary type. In SQL 2008 the data type you can use VarBianry(max), which is Variable size and no maximum limit.

    But Rather than Keeping Audio file inside database Better keep on Hard Disk and path in database.
    There are some related threads please have a look:
    1. http://stackoverflow.com/questions/3458201/how-to-read-and-write-mp3-to-database
    2. http://codesupport.wordpress.com/2011/03/01/mp3/

    For more information, please refer to this Blog about how to store BLOBs in SQL SERVER.
    Regards, Amber zhang
    • Marked as answer by amber zhang Wednesday, February 1, 2012 6:47 AM
    Friday, January 27, 2012 6:15 AM
  • Hello,

    I think the link below will help you.

     http://msdn.microsoft.com/en-us/library/ms190312.aspx

    Friday, January 27, 2012 3:40 PM
  • In addition to transactional consistancy, FILESTREAM used windows NTFS API's for faster performance and doesnot use SQL Server buffer pool. However u should configure it in sql server instance level. Other considerations include your HA strategies.
    Saturday, January 28, 2012 6:32 PM