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
ADVERTISEMENT
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
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
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
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
Nov 14, 2000
hi, I do have over 30 scheduled jobs in one sql server in which I want to have the same jobs in another sql server. What is the best way to copy those jobs?
I thought of backing up the msdb from one sql server then restoring msdb into another sql server..... someone advice me NOT to do so due to potential compatibility problems that he did not explicitly state.
I am hoping to get the answer here.
Thanks
Ahmed
View 5 Replies
View Related
Sep 9, 2005
Hi, How can you copy a table from one server to another server using SELECT statement?
View 1 Replies
View Related
Dec 9, 2007
Hi,
I've got two servers with sql 2005 express on, the first is a shared server at our isp, we rent one database from them. The other server is our own and we have full sa access.
Is there an easy way to copy the database from the shared server onto our own server. We're unable to use the backup.
Thanks
View 3 Replies
View Related
Jun 26, 2007
Hi,
Once a report is deployed to a specific server (server A), is there a way to "copy" it to a different server (servers B, C), without having to actually deploy it server by server?
In my case, I am trying to have the developers deploy the reports on the development server first (server A), and then manually or automatically copy them to a Preview server (server B), and later to a production server (server C). I cannot grant the developers full permissions on the production server, so a "copy" is what I'm thinking about....
Thanks in advance for any ideas.
Edwin.
View 4 Replies
View Related
Jul 31, 2007
Hello. I need to copy all of the rows in a table from a database on one server, to another existing table of the same name in a different database on a different server. I'm trying to use a SELECT INTO statement. Any idea how to do this?I've tried SELECT * INTO DestinationServer.dbo.DestinationDB.DestinationTableFROM SourceTable AS SourceTable_1 But this doesn't work, saying there are too many prefixes. Any idea how to do this?
View 5 Replies
View Related
Sep 14, 2004
Hi,
I am creating a job that runs this command:
EXEC xp_cmdshell 'copy f:dados_sqlmssqlackup
ecom_tb_basico.bak \stalingrado_2c$ emp',
The result of this job is:
"Access is denied.
0 file(s) copied.
NULL"
But I am running this command with sa user.....
Wich kind of permission is missing to execute this copy?
When I execute the same command to copy the backup from the server to itself, it works fine!!!!
Does someone have an idea to solve this problem?????
View 3 Replies
View Related
Oct 20, 2005
I need to move SQL Agent scheduled jobs from one server to another..
Here are the details:
Source Server
SQL 2000 SP3 (upgraded from SQL 7)
Data stored in MsSQL7Data
target
SQL Server 2000 SP4
Data Stored in DATA
DTS Packages have already been resaved on Target Server, how can I copy the scheduled jobs over?
Thanks
View 2 Replies
View Related
Feb 10, 2008
I have a SSIS package which is used to update the OLAP database daily. It includes various processes from the initial dropping of the raw data source tables, rebuilding it, dropping of the OLAP datamart tables (dimension tables and fact tables), re-building it, updating the OLAP dimensions and finally updating the OLAP cubes. I wrote a series of the Sql scripts to perform the tasks except the updating of the OLAP dimensions and cubes, and assigned them to the SSIS package. Everything is working great and it was scheduled with the sql agent to execute at the early hour everyday. We have a single server enviroment for the "Production/Processing" i.e. Database engine, SSIS, SSAS, SSRS are all installed on a single server. By the way we are using Sql 2005.
Recently we split the "Production/Processing" enviroment into two seperated servers. We purchase another server "Production" server and use the existing server as the "Processing" server. I want to copy the success updated OLAP database from the current server "Processing" server to the new "Production" server. How to copy an OLAP database between servers?
Idealy, I believe that the following 5 processes should be assigned after the completion of the OLAP cubes updated at the "Processing" server:
Stop the SSAS at the "Production" server.........I know how to do this in SSIS
Re-name the existing OLAP database at the "Production" server.......not sure how to do this
Copy the newly updated OLAP database from "Processing" server to the "Production" server. If the copy process is succeed, drop the OLAP database that has just been re-named at the "Production" server. If the copy process is failed, re-named the OLAP database that has just been re-named back to the original name.....not sure how to do this. Should it be a Sql script?
Start the SSAS at the "Production" server........I know how to do this in SSIS
Thanks
View 1 Replies
View Related
Mar 23, 2006
I have recently moved from a Microsoft SQL Server 2000 to a SQL Server
2005.
In the good old Enterprise Manager, when I imported a table from a SQL
server to another, I could choose "Copy objects and data between SQL
Server
databases". When choosen, all primary keys, and default values was
copied.
My question is:
Is it possible to do the same in Microsoft SQL Server Management Studio
with
SQL Server 2005? And how do I do it?
I have tried using the "SELECT * INTO NewTable FROM OldTable"
statement, but
it just drops all information about primary keys and default values.
Best Regards
View 1 Replies
View Related
Feb 21, 2008
I want to migrate from one machine to another is it wise to use SSIS "Copy Objects and Data Between SQL Servers" task to accomplish this....migration both data and metadata (in master,model,and msdb ) databases?
View 1 Replies
View Related
May 27, 2015
I have migrated databases and logins from SQL server 2008 R2->SQL Server 2014. Now I also want to migrate/copy the "linked servers". Do you have a step-by-step for this, so that i will copy everything that is necessary regarding logins etc ?
View 2 Replies
View Related
Nov 13, 2006
The DTS Task Copy Server Objects is PAINFULLY slow.
The Copy Table Wizard is fast but generates an unmanagable DTS and does not bring over the indexes.
Any tips or tricks to copy tables, data and indexes and a reasonable speed?
Thanks,
Carl
View 1 Replies
View Related
Jul 26, 2006
Hi, I am trying to use SQL Server 2005 Enterprise Edition to copy tables from my local server to my hosts server at brinkster.com. In the old version you could use DTS, but everything seems to have got far more complicated now! Please can anybody guide me in the right direction? Thanks a lot.
View 2 Replies
View Related
Sep 9, 2004
Can I move a database from one server to another server using QA?
EXEC sp_detach_db @dbname = 'IISLOG'
EXEC sp_attach_single_file_db @dbname = 'IISLOG',
@physname = 'c:Program FilesMicrosoft SQL ServerMSSQLDataIISLOG.mdf'
Or would I need a tape backup to move this database to another server?
Thanks
Lystra
View 1 Replies
View Related
May 18, 2006
I'm trying to copy files between 2 servers on a local network from within aSQL Job (and Query Analyzer) using xp_cmdshell.xcopy but get an accessdenied message returned.I'm able to successfully do the copy from within a command window so thinkthe problem has something to do with using the default SQL Server accountbut as yet I don't know how to resolve.Any help/suggestions would be much appreciated.
View 1 Replies
View Related
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 1 Replies
View Related
Sep 28, 2007
Hi-I have a sql 2005 database that stores weekly time and attendance data for 500 users. I need to send the file on a scheduled basis.I'd alo like to have programmatic control over sending the file via my asp,net application's admin pages. (I have roles and security set up on the site) My question is two fold: Can asp.net be scripted to manage a data extraction to a file, (I gotta HOPE so) THEN is there any sFTP functions built into asp.net?I know I can do this in SQL2005, then have a scheduled event fire off the file via sFTP. but like I said, I'd like to have programmatic control over the file sending. (Of course they have to be sent on SUNDAY!) Thanks in advance for any advise
View 6 Replies
View Related
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
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
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
Oct 8, 2007
Brief overview...Running SQL Server 2003 Server Enterprise 64 bit - All Service Packs and patches current
SQL Server 2005 Enterprise Edition 64 bit Build Microsoft SQL Server 2005 - 9.00.3054.00 (X64) Mar 23 2007 18:41:50 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)
I cannot import any SSIS packages nor crete any new folders under stored packages. I hve googled the news groups and looked at BOL to no avail. HELP!!!!
View 20 Replies
View Related
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
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
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
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
Jul 11, 2007
Run the SSIS import/export wizard.
(xls -> sql table)
Select the tasks created.
Copy.
Here is the error that occurs.
p.s. Does anyone have any needles I can borrow? I think sticking them in my eyes would be nicer than working with SSIS.
===================================
An error occurred while objects were being copied. SSIS Designer could not serialize the SSIS runtime objects. (Microsoft Visual Studio)
===================================
Could not copy object 'Preparation SQL Task' to the clipboard.
(Microsoft.DataTransformationServices.Design)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.762&EvtSrc=Microsoft.DataTransformationServices.Design.SR&EvtID=SerializeComponentsFailed&LinkId=20476
------------------------------
Program Location:
at Microsoft.DataTransformationServices.Design.DtsClipboardCommandHelper.SerializeRuntimeObjects(ICollection logicalObjects)
at Microsoft.DataTransformationServices.Design.ControlFlowClipboardCommandHelper.InternalMenuCopy(MenuCommand sender, CommandHandlingArgs args)
===================================
Invalid access to memory location. (Exception from HRESULT: 0x800703E6) (Microsoft.SqlServer.ManagedDTS)
------------------------------
Program Location:
at Microsoft.SqlServer.Dts.Runtime.PersistImpl.SaveToXML(XmlDocument& doc, XmlNode node, IDTSEvents events)
at Microsoft.SqlServer.Dts.Runtime.DtsContainer.SaveToXML(XmlDocument& doc, XmlNode node, IDTSEvents events)
at Microsoft.DataTransformationServices.Design.DtsClipboardCommandHelper.SerializeRuntimeObjects(ICollection logicalObjects)
View 14 Replies
View Related
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
Jan 29, 2006
hi.
how can I copy any mdf file to another folder without stopping sql server?
View 8 Replies
View Related