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.
| Author |
Topic |
|
rbfigueira
Starting Member
4 Posts |
Posted - 2004-01-27 : 10:41:16
|
| Friends,I need to do this :I have to make one JOB that will run one DTS all days.This DTS will import one txt file to one table in database.Something like this:Step 1 - Will check if the file exist. If is true (exist) the go to Step 2, else end the DTS.Step 2 - Import the text file to the sqlserver tableThe Job/DTS will never give us an error on step 1 because only verify if the file exist or not.The step 2 only will be execute if the file exist.How to do that ??I need some help ;)ThanksBest Regards,Ricardohttp://www.rbfigueira.net |
|
|
nr
SQLTeam MVY
12543 Posts |
|
|
rbfigueira
Starting Member
4 Posts |
Posted - 2004-01-27 : 10:53:00
|
| Thanks NR !I must to use the DTS :/Ok, but how can i use that code ?I will put that on Active script task ?Can you give me the steps to do the right think....I dont know how to put this to work :(Sorry but i am not good on DTS manual stuff...Best Regards,Ricardohttp://www.rbfigueira.net |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-01-27 : 11:08:16
|
| Yes use an activex script.In it putFunction Main()dim objFSysdim objFStreamdim sLine Set objFSys = CreateObject("Scripting.FileSystemObject") if objFSys.fileexists("c:\a.txt") then Main = DTSTaskExecResult_Success else Main = DTSTaskExecResult_Failure end ifEnd FunctionThen use the workflow to take a success or failure path.==========================================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. |
 |
|
|
rbfigueira
Starting Member
4 Posts |
Posted - 2004-01-27 : 11:40:48
|
| Thanks Friend :)Now I understand :o)Thanks for your all help !!!Best Regards,Ricardohttp://www.rbfigueira.net |
 |
|
|
|
|
|