[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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