dbTalk Databases Forums  

importing DBF files into SQL 2000

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss importing DBF files into SQL 2000 in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jaylou
 
Posts: n/a

Default importing DBF files into SQL 2000 - 08-16-2006 , 03:37 PM






I need to create a DTS package that checks for files on a server and if they
exist I need to import them into a SQL 2000 table.

I created an ActiveX script to check for the files, on success of the
scripts I run a data transformation from the DBF into SQL. The issue is if
the first file doesn't exist I dont want to fail the job I want it to go
check for the next file name. In an activeX script is there a way to stop
the failure and move to another step in the package? Can I incorporate a
data transformation step in the activeX?

TIA,
Joe


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: importing DBF files into SQL 2000 - 08-16-2006 , 03:57 PM






Joe,

It sounds as though you want some conditional workflow. How do you check
for the files? We do something similar here and I do not think you need to
fail the package based on whether a file is found or not.

Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)



--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



"jaylou" <jaylou (AT) discussions (DOT) microsoft.com> wrote

Quote:
I need to create a DTS package that checks for files on a server and if
they
exist I need to import them into a SQL 2000 table.

I created an ActiveX script to check for the files, on success of the
scripts I run a data transformation from the DBF into SQL. The issue is
if
the first file doesn't exist I dont want to fail the job I want it to go
check for the next file name. In an activeX script is there a way to stop
the failure and move to another step in the package? Can I incorporate a
data transformation step in the activeX?

TIA,
Joe




Reply With Quote
  #3  
Old   
jaylou
 
Posts: n/a

Default Re: importing DBF files into SQL 2000 - 08-17-2006 , 08:44 AM



I am using the below activeX script:
On sucess of this step I am using a transfer data task to import the DBF
file into my SQL table. Your example shows how to import in a text file, but
I can't find a way to import a DBF file.

Thansk again,
Joe


Option Explicit

Function Main()
Dim oFSO, sFileName

sFilename = "\\en1\dls\OLICYF\WXP817.DBf"
Set oFSO = CreateObject("Scripting.FileSystemObject")
If oFSO.FileExists(sFilename) Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End If

Set oFSO = Nothing
End Function



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.