Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Audio file in SQL Server CE

Posted on 2011-02-14
1
Medium Priority
?
229 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 40

Accepted Solution

by:
lcohan earned 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

926 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