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
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Calling DTS From Java...

Author  Topic 

dbleyl
Starting Member

21 Posts

Posted - 2003-03-26 : 08:05:08
Hi,

I have a DTS package which exports data to several MS Access 2k databases as part of a build process.

I created stored procedure wrappers of the 'xp_cmdshell 'dtsrun...'' variety, so I could execute them from java.

The problem with this approach is that I need to export 1 table at a time so Access doesn't bottleneck, but the sp's return immediately.

I abandoned this approach in favor of calling dtsrun from with my java code.

The dts packages all consist of:
1.) An activeX script to delete/copy Ms Access files (FileSystemObject).
2.) A data transformation task, SQL Server7 to Access 2k.

(One dts uses the ODBC access driver with dsn because it runs smoother on large sets(?)).

The java code is as follows:
Process p = Runtime.getRuntime().exec("dtsrun /S
servername /E /N dtspkgName");
p.waitFor();

What happens is that the dts package runs, dtsrun appears in the task, the ActiveX script is executed, the files are copied, and the data export begins, but hangs after 68 rows.

I've tested all the dts packages, and they all execute directly ok.

Any tips on running DTS from java?



dbleyl
Starting Member

21 Posts

Posted - 2003-03-26 : 08:24:34
I have tracked the issue down to bad data - null in a non-null column.
Strange thing that the process doesn't end.

The error message seems to be asking for some kind of user intervention [paraphrase] 'You can not enter a null value into this field, please enter a value for column x...'

I can fix the corrupt data, which will fix my problem short-term, but I'd like to get a error code return value from DTS rather than letting it just hang.

Any ideas?

Go to Top of Page
   

- Advertisement -