Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to run DTSRUN or call a DTS package from another PC?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00926329
Message ID:
00927180
Vues:
101
Hi Kurt,

I've tried setting asynchronous property to .T. with SQLSETPROP() but it doesn't let me exit my application until the SQLEXEC() finishes. Why? I don't know, perhaps it's because xp_CmdShell also doesn't give me control back even when I try it n Query Analyzer. I'll try creating the job I hope that works.

Thank you,

Luis



>Luis,
>
>Look into the SQLSETPROP() and try setting the asynchronous property to .T.. This should do want you want but I haven't tried it so I can't say for sure. Another option is to create a job that executes the stored procedure and then use SPT to start the job by calling msdb.dbo.sp_start_job. As soon as the job starts, the procedure returns control back to your application.
>
>USE msdb
>EXEC sp_start_job @job_name = 'Nightly Backup'
>
>Kurt
>
>>Hello Kurt,
>>
>>Thank you very much for your help! I finally implemented the 'xp_CmdShell' solution that I call from my app with SQLEXEC. I call my app from the .BAT file and it works great! Now I want to continue with other processes that I call from the .BAT file. The DTS I use just re-process a cube created in SQL Server's "Analysis Services". I don't want to wait until this process finishes. is it possible to do the SQLEXEC() call in an asynchronous way? Let's say, I do the SQLEXEC() asynchronously and the I close my app then I call another app that is also called from the same .BAT file. Is it possible?
>>
>>TIA.
>>
>>Luis
>>
>>
>>>Luis,
>>>
>>>DTSRUN will only execute on the pc if the SQL Client tools is installed. A better approach is to have the SQL server execute the DTS package. That way the procedure is portable regardless of the pc. You need to make sure that whatever tasks that are performed in the DTS package, the server has access to those folders, COM objects, etc. One way to test this is to go into enterprise manager and schedule the DTS package by right clicking on the DTS package and select 'Schedule Package'. Schedule it to run within the next couple of minutes. If the package executes correctly, you can create a stored procedure to run the DTS similiar to how you did it in the batch file.
>>>
>>>
>>>CREATE PROCEDURE ExecDts AS
>>>
>>>EXEC master.dbo.xp_cmdshell 'DTSRUN /S MainServer /U MyUser /P MyPwd /N MyDtsPackage'
>>>
>>>
>>>Now the only thing to do is to have some way to execute the stored procedure. You can use either SPT or ADO to execute stored procedures. Unfortunatly there is no way of executing this via a batch file unless you want to install the SQL client tools.
>>>
>>>Hope this helps.
>>>Kurt
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform