Copy External Files To Different Locations

Dec 14, 2005

Hi,

I'm fairly new to SQL, waiting on a course on how to use it, but wanting to get stuck it.

I was wondering how I can get SQL to copy a file, say in Access, from one location to another.
This would be part of my job with delivering data extracts users.

Many thanks in advance

View 5 Replies


ADVERTISEMENT

Copying Backup Files To Different Locations

Oct 25, 2007

I have a maintenace plan that copies production backup files in DR server. The production is mission critical and runs 24/7. We have a round the clock backups. Backups include full backup, differential backups and log backups.

To secure these backup files, I was asked to keep these files in different server at the same time as it goes to DR Server. As I am using maintenace plan for scheduled backups that go to DR server and I had no idea how to incorparate copying these files to another server in the same maintenence plan. I came up with idea using xp_cmdshell stored proc that I attached on the maintenace plan in executeT-SQL statement task. The statement looks like


Exec master..xp_cmdshell 'copy e:DRbackup*.bak \fgh-sql16ackup$'

Above statement copy all backup files on DR server and takes these to remote server called fgh-sql16.

My question here is ....are there any other effective methods to copy backup files simultaneously to different servers via maintenace plan.

Thanks all

View 6 Replies View Related

Multiple Data Files && Locations

Oct 23, 2007



What is the recommendation for having multiple data files ? I've read 1 per CPU etc... some say keep it all in one data file.

How do multiple sql data files help when they are located in the same raid group/single volume ?

This is the setup that I have:
4 CPU box with 2x P400 array controller to 2x MSA10 exclosure (for data only, tempdb,logs,backups are on other arrays)
one array controller per enclosure. single big RAID 10 volume on each ( or should I do 4-4-2 separation).
(In single big raid 10, All disks would help for performance of each query... I don't want to create separate raid groups, mostly due to growth constraints in the future, am I wrong ?)

How should I split database across these two enclosures ? one,two data files on each or more ?

How would this look in OLAP vs OLTP scenarios ?

Thank you.

View 1 Replies View Related

Detach-copy-attach: Can Not Copy Files - Getting Access Denied

Feb 28, 2008



Hi!
I did:
alter database mydb set single_user with rollback immediate;
exec sp_detach_db @dbname='mydb', @keepfulltextindexfile='true';

then I tried to copy files to new location on other drives, same server but got
>>Cannot copy <myfile>: Access is denied
Make sure the disk is not full or write-protected and that the file is not currently in use<<

I also tried rename of file without success.
I also tried with db service stoppet (not preferred) without success.

How to find out, which process locks the files?
Best regards

View 7 Replies View Related

Error Handling When Calling External Sql-Files

Oct 1, 2005

I am using SQL Server 2000. I have some files with SQL-Statements.The SQL-Serveragent runs jobs which execute the SQL-Files:(e.g. osql /E /n /i \serverd$lager_pool.sql)How can I implement an error handling.If an error occurs, the script stops, and I can't read the variable@errorMy script - table xy doesn´t existSELECT * FROM XYSELECT @@errorSELECT 33The execution stops with an error after the first lineThanks for your help.aaapaul

View 3 Replies View Related

External Component Has Thrown An Exception - Can't Load .dtsx Files!

Apr 2, 2008

Help,

I get the following exception anytime I attempt to open a .dtsx file in the SSIS project in VS2005:

"External component has thrown an exception. (System.Windows.Forms)"

I haven't made any changes to this project and it was up and running fine a week or so ago. Any ideas? Help.

Thanks - Wayde

View 5 Replies View Related

Cannot Copy Files

Mar 24, 2007

I copied a database using backup and restore from Sql server 2000 to Sql server 2005. I noticed the data(mdf) and log(ldf) files did not copy. when I try to do a copy and past it gives me an error: cannot copy lof: it is being used by another person or program. Close all programs and try again. Does this mean I have to stop both servers to copy between them? Please help.

View 1 Replies View Related

How To Copy Txt Files From FTP?

Dec 20, 2007

Hello, everyone:

I want setup a scheduled job to copy txt files from FTP to local hard drive. How to open FTP and copy files from SQL Server Query Analyzer?

Thanks

ZYT

View 5 Replies View Related

Copy Files From FTP

Feb 5, 2008



I have been looking for a way to copy only new flat files from an FTP server. I can find how to copy all of the files into another directory, but I only want to copy in files that are not already in my target directory.

So, is there a way to compare the files in the FTP directory to a list of files in a SQL table and use this to control the transfer, and how do I get those FTP file names into a SQL table? Or is there some other way?

Thanks in advance for any help.

Graham

View 4 Replies View Related

How To Copy Files Using Xp_cmdshell

Nov 18, 2007

Howdy, hope someone can help me out with this.I want to run a job each night that copies files from one server to another.I cant even get a simple copy one file from one directory to another,statement to work.When I try :@cmd 'copy c: empfile1.txt c:ackupsfile1.txt'master.dbo.xp_cmdshell @cmdI get the msg: 'c' is not recognised as an internal command, program orbatch file, Null.What I ideally want to do is pass xp_cmdshell variables for the 2 file'spath+names. I have tried numerous variations of single and double quoteswithout success, which is why I decided to work up form the simple 'copyc: empfile1.txt c:ackupsfile1.txt', but can't even get that to work.Any advice much appreciated.

View 3 Replies View Related

Using MS SQL Server To Copy Files

Jul 20, 2005

Hi,I'm having some trouble finding any information on this topic - can MS SQLserver 2000 copy/delete files on the host computers disk.Any info on this would be great.Thanks,Eirik

View 2 Replies View Related

Copy Files Dynamically

Jan 11, 2008

hi , I am trying to copy files dynamically from a remot folder by using File System task ,
the files are going to be generated daily with f1yyyy-mm-dd.txt
I created 3 file connections :
- Existing remote folder (RemotFolder) and set that to var v_remotefolder
- Existing destination folder (DestFolder)
- existing file (filename) and set the expression to var (string ) =v_fname
in the File System task I set the the
Destination connection = DestFolder
Operation =Copy file
Source = filename
expression >>Property (source) = @[User::v_remotefolder] + @[User::v_fname]
I know I need the date too ,but I 'm getting error on this step.
Can you please tell me if you know how to resolve this without using For each loop since I don't have control on the remote folder and I don't want to copy unneeded files (the files are 10 GB daily) and get delete it once every month.
-I know this not uncommon task but I can't find any example.
Thanks



View 3 Replies View Related

Data And Log Files Won't Copy

Mar 24, 2007

I copied a database using backup and restore from Sql server 2000 to Sql server 2005. I noticed the data(mdf) and log(ldf) files did not copy. when I try to do a copy and past it gives me an error: cannot copy lof: it is being used by another person or program. Close all programs and try again. Does this mean I have to stop both servers to copy between them? Please help.

View 5 Replies View Related

Xp_cmdshell Can&#39;t Copy Files From Different Domain

Jun 19, 2000

I was trying to copy backup files from production domain to test domain nightly using xp_cmdshell. I

View 3 Replies View Related

Using Agent To Copy Files Between Servers

Aug 10, 1999

I connect to remote servers using PPTP connection. There are 4 web servers and 1 production server on the other side of the firewall. From my staging server, I am supposed to archive the NT event logs(Application and system) for each of the servers.

To solve this problem, I have mapped the C drives of each of the remote servers to my local staging server. I then created a batch file, webevnt.bat containing code,

G:
Cd winnt
Cd system32
Cd config
Copy sysevent.evt c:eventarcweb01sysevent.evt
Copy appevent.evt c:eventarcweb01appevent.evt

Then I used SQL Agent to create a job of type, Operating system command(cmdexec) and typed the following command :

C:atch_~1eventl~1webevnt.bat

When I run the command, C:atch_~1eventl~1webevnt.bat through the command prompt, the files are copied with the correct modified date.
The output is,
1 file(s) copied
1 file(s) copied
But, when I use SQL Agent and start the job containing the same command, the job runs successfully but, the files have a wrong modified date. Moreover, when I view the job history for this job, it says, specified drive not found. 1 file(s) copied. 1 file(s) copied.

Please let me know why this happens.

Thank you.

Praveena

View 1 Replies View Related

Copy Mdf Files Without Stopping Sql Server

Jan 29, 2006

hi.

how can I copy any mdf file to another folder without stopping sql server?

View 8 Replies View Related

Way To Copy Files From Network To IP Site

Jul 21, 2015

I was wondering if there is a way to copy files from a network to an ip site where you would need to log in at. What I am trying to do is make a SP that would take all .csv files from the network drive and place them in the other ip address folder however you would need to use the login information.

View 5 Replies View Related

Copy Folders And Files To Different Location

May 15, 2007



I have a situation from where I need to loop through different folders and files in these folders. After processing these files, I need to archive these folders to different location.



e.g., C:MainFolderMar01 ==> Multiple files in Mar01 folder

C:MainFolderMar02 ==> Multiple files in Mar02 folder



Does any one know the best way to do this in SSIS?



Thanks in advance.



BC

View 1 Replies View Related

Copy Files Into Same Destination Directory

Mar 14, 2008



Hi,

How do I copy files from several subdirectories into the same directory? I have about 80 subdirectories of a parent directory from which I want to copy the files and place the copies into the same, flat destination directory. I tried using the copy file and copy directory file system tasks, but this always seems to recreate the subdirectory structure under the destination directory.

How can I get around this in SSIS?

Thanks in advance,

Bruce.

View 6 Replies View Related

SSIS - Best Way To Copy Files From One Directory To Another

May 8, 2007

In SSIS, I was to:

take files from c:directory1
copy them to cirectory2 with a different name (concatenated date on the end)
delete them from c:directory1

Should I be using the Script Task for this? I am wondering if I should be using the File System Task which copies directories or files, but I don't know if I could rename the files during the copy.



Also, I want the directory names to be in the configuration file. I am not sure how to do this. If I set up a flat file source connection, I need to specify a file name and I just want the directory names. How do I get them in the config file and how to I read them into my script from the config file?



Linda

View 25 Replies View Related

Use SSIS To Copy Files Between Servers?

Apr 27, 2006

This is a question of whether or not to use SSIS to solve a problem.

I need to copy SQL Server database backup files from a server in the DMZ to a fileserver inside the firewall. The SQL Server is not allowed to write it's backup files directly to the fileserver, so they are written to local disk. A connection can be made from inside the firewall to the SQL Server to copy the files off.

So, I'm considering SSIS for the job. Is it possible to use SSIS to perform the file copies from one remote server to another? If so, is the FTP task required, or can File System tasks be used?

An alternative would be Windows scripting, xcopy, robocopy, etc. but I like the features of SSIS and would like to take advantage of it's flow control, error handling, database scheduling, etc.

Any tips, sample code, etc. would be appreciated.

Thanks,

david

View 4 Replies View Related

T-SQL Commands To Copy Files && Stored Procedures

Mar 20, 2008

I am looking to implement a system whereby a given user can 'authorise' changes to the system itself and promote from test to live.
For instance a user might be running an application which has a SQL 2005 database DataA opena nd runnign stored procedures from that.   I'd like a Stored procedure in that able to copy over a given stored procedure from a different database - DataB and copy into DataA.  Is that possible?
Also is it possible from T-SQL to copy files on the servers underlying filesystem?  Ie to copy some .aspx files from one location to another.
Regards
Clive
 
 

View 12 Replies View Related

SQL 2012 :: Copy Backup Files From One Server To Another?

Sep 23, 2014

I've an emergency requirement to copy Source server database backup files to destination Server through xcopy command. Backup job on source server runs daily, so once this job get completes all databases backups needs to be moved to destination server. But here the main concern is "the backup files on destination server shouldn't be overwritten, they should be placed separately as Source server job runs daily".

We've a command which overwrites backups on destination server. But we need to keep backups on destination at-least for 4 weeks (means : retention should be 4 Weeks).

View 5 Replies View Related

Copy Files From Another Server To Computer With Robocopy And Job

Feb 4, 2015

I have one job for copy files from another server to my computer using Robocopy.but when I execute my job in sql server I get this error:

Accessing Source Directory 192.168.101.191Upload
Access is denied.
this is my job:
USE [msdb]
GO

/****** Object: Job [Test] Script Date: 02/04/2015 13:08:00 ******/
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
/****** Object: JobCategory [[Uncategorized (Local)]]] Script Date: 02/04/2015 13:08:00 ******/
IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'[Uncategorized (Local)]' AND category_class=1)

[Code] ....

Should I create Credential and proxy?How can I do this?Would you mind giving me required scripts for this?

View 2 Replies View Related

Copy Bak, Trn Files To File Server With Robocopy.

Nov 29, 2007

I need help with better solution to copy my bak and trn files to a file server. This is the background. I use to dump the backup files directly to the file server; this was not €śbest practices€? according to some books and forums. Back to dump the file first to local disc and after that letting robocopy copy the files to the file server. And I end up with this problem.


This is error from the backup log
Failed-1073548784) Executing the query "BACKUP DATABASE [BPROJCT] TO DISK = N'F:\backup\BPROJCT\BPROJCT_backup_200711281700.bak' WITH NOFORMAT, NOINIT, NAME = N'BPROJCT_backup_20071128170005', SKIP, REWIND, NOUNLOAD, STATS = 10
" failed with the following error: "Write on "F:\backup\BPROJCT\BPROJCT_backup_200711281700.bak" failed: 112(There is not enough space on the disk.)


This is the error from the robocopy log
New File 0 BPROJCT_backup_200711201700.bak
2007/11/20 17:02:11 ERROR 32 (0x00000020) Copying File F:ackupBPROJCTBPROJCT_backup_200711201700.bak
The process cannot access the file because it is being used by another process.
Waiting 30 seconds... Retrying...


Robocopy tries to copy the file before its completely written to disk. I have made a batch file that looks like this
robocopy



"F:ackup" "\sefwg-sqlbackackupACON" *.* /MIR /TBD /MON:1 /MOT:5 /LOG+:"F:ackupackup.log" /NP


Monitor the file folder and copy all files every 5 min, the file is started with scheduled Task.
Have I missed some switch? Can start robocopy from SQL Serer Agent in a xp_cmd_shell?

View 1 Replies View Related

Copy Files After Backup In Maintenance Plan

Sep 19, 2007



Hello,

We're new users of SQL Server 2005. I created two maintenance plans...one to backup the database at 2 AM daily and one to back up transaction logs every 30 minutes. These maintenance plans write to a local disk. What we want to do, within the maintenance plan, is copy the files as soon as they are written to a remote server. Is that possible?

Thanks in advance.

View 7 Replies View Related

Seagate Backup Exec Will Not Copy DAT Database Files

Feb 10, 1999

We are having a problem with trying to backup the database device and log DAT files located in the MSSQLData directory.
The Seagate Backup Exec. states that the files are busy and skips them during its backup cycle. It skips all the devices in the
directory.

Any suggestions?

View 3 Replies View Related

Initialization Merge Subscription Without Copy Data In Bcp Files

Sep 27, 2007


Hi All!


Microsoft SQL Server 2005 - 9.00.3159.00 (Intel X86)
Mar 23 2007 16:15:11
Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)


40 subsribers.
Adding new article.
On any aubscribe need regenerate snapshot agent agent.
The tables are very big. With filters.
Regenerating process anew copy data in in ...ReplDataame.bcp, during 30-40 minutes for any subscriber!
Full work to small correct of replication flow during 2-3 days....


Is it possible to initialize subscription without copying bcp data?

View 5 Replies View Related

SSIS Job Execution Fails | Copy Files From Remote Machine

May 13, 2008

Hi All

One of the step in sql agent job is to execute the SSIS package to copy files from remote shared location to local server where sql server is installed. The account on which SQL agent runs as has access to remote shared location. However SSIS package always fails with following error:

An error occurred with the following error message: "Access to the path '\sharedlocationBCKTST105092008.csv' is denied.".

We have tried using proxies but same issue come with proxy also.
When using proxy, we created a proxy for a user who has access on that shared folder on Windows server(from which files are to be copied). If we login to SSIS server with the above user and execute SSIS package manually it works fine. However if we login with different user and run the job via SQL agent using proxy of the above user, then job fails throwing same above mentioned error


Any help is highly appreciated.





Thanks

View 3 Replies View Related

SQL Server 2008 :: Copy Multiple CSV Files Into Database Using Stored Procedure?

Feb 9, 2015

I need to import multiple csv files and load into table and everytime new database has to be created .

I was able to create new databases using stored proc

How do i do a bulk insert for all the files at once to insert into tables .

i want to load all the files at once .

View 6 Replies View Related

Bulk Copy Command Or Exporting Data Table Wise From Database To CSV Files

Dec 10, 2013

I am using Bulk Copy command for Exporting data table wise from database to csv files and it was working fine. Since last 3-4 days when exporting for some tables data in csv file is coming junk.

View 1 Replies View Related

Integration Services :: Copy CSV Files From One Location To Archive Folder Need To Rename With Current Date

Jun 4, 2015

I have Developed ETL Package Which Supplying the CSV File, if I run the package Next time if Same File name  is there I need to Rename the that File with Currentdatetime need to move in to Archive Folder. if that File is not exist in that location no need to move the file into Archive file.

View 4 Replies View Related

Oracle And MS SQL Locations

Jan 17, 2007

Can oracle91 and MS SQL2005 be on same server

View 20 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved