Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Jobs

Author  Topic 

MxWebb
Starting Member

8 Posts

Posted - 2007-02-05 : 09:02:13
I need some direction on SQL Jobs.

I can handle the setting up a SQL Job/DTS Package.

What I have is SQL Statement I need to run that creates a txt file Renames file to AUX_Export_020507.txt then zips that text file and Name it AUX_Export_020507.zip. Then move the zip file to a FTP directory.
I would like to get email after it runs also.

This issue I am having is the Part that zips the file
Renames the text file and zip file to add the current date on end like I have above and move it to a FTP directy..

The old days we would creat an autoex.bat file to move and rename.

Thanks
Michael Webb

nr
SQLTeam MVY

12543 Posts

Posted - 2007-02-05 : 10:49:31
You can use xp_cmdshell to execeute the same commands that you would put in the .bat file.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

MxWebb
Starting Member

8 Posts

Posted - 2007-02-05 : 11:53:13
Another Question! There is a DST package on server under data transformation Server that I don't know what its used for. How can open it and see what this Package is actually doing?

2nd Question how come the it was created in transformation Server instead of being under Management??

Thanks
Michael Webb
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-02-05 : 12:09:23
1. You should be able to open the package in enterprise manager to see what it does if you are sysadmin.
2. It has just been saved to the server but a job hasn't been created so it's not scheduled (or a jobs been created and renamed).


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

MxWebb
Starting Member

8 Posts

Posted - 2007-02-05 : 12:20:34
Back to my first issue. After looking into this more why couldn't I use the designer tool? There is a Email task.
not sure if I can Rename the Text on the fly (FileName = "AUX_Export_" & Month(GetDat()) & Day(GetDate() & Year(Getdate()) NOTE how I can only get the last part of the year 07.

Then Zip the file with samename.



Thanks
Michael Webb
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2007-02-05 : 12:45:18
>> how I can only get the last part of the year 07.
I've forgotton all I ever knew about dts but convert it to char then do a right.
Where are you doing this - is getdate() allowed rather than now?

If you can use the email task then go for it.
Look at the dynamic properties task to see what you can change easily otherwise you can probably do it with an activex script.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -