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)
 DTS - error importing data from 0 byte file

Author  Topic 

bridge
Yak Posting Veteran

93 Posts

Posted - 2005-10-27 : 01:22:21
I have a DTS package that imports data from a txt file to a SQL Server table. But when the txt file has 0 byte its gives error when the DTS Step is executed. Is there any way it does not report any error when importing data from a 0 byte file.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-10-27 : 01:56:22
there shouldn't be any error...

try nr's bcp routine http://www.mindsdoor.net

or post your statements and error message

--------------------
keeping it simple...
Go to Top of Page

bridge
Yak Posting Veteran

93 Posts

Posted - 2005-10-27 : 02:43:48
execute this script

create table Export(
test_id int not null primary key clustered,
test_dsc varchar(15)
)

create table Import(
test_id int not null primary key clustered,
test_dsc varchar(15)
)

insert into Export
select 1, 'Export-1' union all
select 2, 'Export-2'

now make a DTS package. Firstly take SQL Server as source and Export.txt as destination and export data from Export table to Export.txt.

Now take Export.txt as source and SQL Server as destination and import data from Export.txt into Import table.

Now execute the command
delete export

then Execute the Export Step and import step. This time on import step you'll get the error.

I want to know is there any way I could stop this error?
Go to Top of Page
   

- Advertisement -