Solved

Audio file in SQL Server CE

Posted on 2011-02-14
1
223 Views
Last Modified: 2012-05-11
Hello Expert

I am trying to load an Audio file (.wma) into compact Edition Database.

My audio file is in c:\Audio\ directory

What is the SQL command that I execute from SQL Server Manager the load the file.

Also what is the best data type to make the Audio field.

I am a beginner, so detail code please

Thanks
0
Comment
Question by:crp81
1 Comment
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 34901252
Here, try this but remember your C:\ path or wherever you put your binary file is relative to the SQL server box and not client where you run the query. If SQL is installed on your client computer run it from there ok:

create table #tempfile (audio_file varbinary(max))
INSERT INTO #tempfile   SELECT * FROM OPENROWSET(BULK 'c:\audio_test.wma', SINGLE_BLOB) as f;
select * from #tempfile
drop table #tempfile
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question