• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

Copy .wav files identified in a query, to a set folder on the C: drive

I have a table called call_recordings,  each record contains the details of each call that has been recorded.

It has it has a column called [audio_filepath], this contains the filepath of the corresponding call recording .wav file
e.g. 'C:\AM CR Data\DATA\Audio\31102008\20081031_105508_797_01_004.wav'

What i want to do is run a query and copy all the files into another directory e.g 'C:\Burning\CopiedRec\'

How would i go this?

0
meteorelec
Asked:
meteorelec
  • 4
  • 3
1 Solution
 
David H.H.LeeCommented:
Hi meteorelec,
Do you meant update the current old physical location to new directory?
If yes, you can update the query like this:
Query
--------------
UPDATE tblRecords
SET audio_filepath=REPLACE(audio_filepath,'C:\AM CR Data\DATA\Audio\31102008\','C:\Burning\CopiedRec\')
0
 
meteorelecAuthor Commented:
No i mean actually copying the file to the new directory
0
 
David H.H.LeeCommented:
Hi meteorelec,
You can try with this:
exec xp_cmdshell 'copy C:\AM CR Data\DATA\Audio\31102008\ C:\Burning\CopiedRec\'

However, you can check this PAQ regarding the details.
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_23181726.html
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
meteorelecAuthor Commented:
x com,
 I'm getting this error message when i execute xp_cmdshell:
 Msg 50001, Level 1, State 50001
xpsql.cpp: Error 1314 from CreateProcessAsUser on line 636
 
0
 
David H.H.LeeCommented:
Hi meteorelec,
It seem like security permission issue. Please check this articles that proposed the setting:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=45799

I'm not sure about your permission level there, please provide more details if you need any further assistance.
0
 
meteorelecAuthor Commented:
I've acually already read that article when i was getting another error message do do with user no have permission,
once i made the changes mentioned in the artical, i started getting this error message.
 
 
0
 
David H.H.LeeCommented:
Hi meteorelec,
Perhaps you can try with default "master" database and perform the xp_cmdshell function as proposed.
Can you mention your environment settings there? Let's see any changes that missing there.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now