Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Creating a DTS Package
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 29 October 2003 :  18:07:08  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I have a delimited text file that I want to import into a sql server 3 times a day. I was told I should make a DTS package, but I have never done this. Any ideas or pointers using VB6?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 29 October 2003 :  18:38:48  Show Profile
VB6 is not required
You need to create a DTS package in Sql Server and schedule it to run when you want.
Go to your Sql Server db
Go to Data Transformation Services
Go to Local Packages, right click and click New Package
Drag and drop Text File Source from the left pane to the right and set the source.
Drag and drop Microsoft OLEDB driver for Sql Server as above
Configure the transformations between the text file and db table
save DTS package
schedule it!

The UK MkIVs Forum
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 29 October 2003 :  20:43:28  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Sounds easy enough, now to try it

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 29 October 2003 :  21:16:50  Show Profile  Visit Jeepaholic's Homepage
DTS makes it ridiculously simple...it'll even show you a few lines of your text file to make sure you're mapping data correctly to various DB fields.

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 29 October 2003 :  21:52:34  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Yea DTS was simple, but now I have created the DTS package but it saves it in SQL Server and I want the file saved so I can run the file from a different computer and the location of the text file I upload is not always going to be the same name or location.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 30 October 2003 :  04:34:53  Show Profile
You can save a DTS package to a file, it's a bit tricky to find but it's there somewhere.
Can't think of a solution to the filename problems, i've always done this using the same names and locations.

The UK MkIVs Forum
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 30 October 2003 :  08:37:41  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I will search google today and hopefully find it, thanks for at least letting me know it is possible.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

CarKnee
Junior Member

USA
297 Posts

Posted - 30 October 2003 :  09:59:42  Show Profile  Visit CarKnee's Homepage
I had the same deal. I needed to runa package ona machine that didnt run SQL Server, itjust had the Enterprise Manager on it. Here is what I did:

I saved my DTS package locally as a "Structured Storage File"
I then set up Windows task scheduler to run "dtsrun" every night a midnight:
"dtsrun.exe /F c:\path\YourDtsPackage.dts /N PackageName"

Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 30 October 2003 :  10:31:52  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Where are the options to save as a structured Storage File?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 30 October 2003 :  10:47:44  Show Profile
Here's how to save a DTS Package:

Open the package
Go to Package > Save As
Change location to Structured Storage File
I will save as PackageName.dts

The UK MkIVs Forum
Go to Top of Page

snaayk
Senior Member

USA
1061 Posts

Posted - 30 October 2003 :  12:01:35  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
quote:
Originally posted by redbrad0

Yea DTS was simple, but now I have created the DTS package but it saves it in SQL Server and I want the file saved so I can run the file from a different computer and the location of the text file I upload is not always going to be the same name or location.



The same name is not so much an issue. If you place it in it' sown directpry, you can create an activex script and use FSO to rename the file whatever you want. Or yo can find the name of the file and set up a global variable that can be accessed by any process in the package.

The different location is a tougher one. What type of location will it be? ftp site, http site, different drives, etc??
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 30 October 2003 :  12:18:40  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Well I should be able to make it always be stuck in one directory, but wish there was a way you could create a DTS package and have it read the variables from a text file on what file to open, where to send it (sql server address and password), just all of those kinds of things.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 30 October 2003 :  12:36:24  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I just had DTS create a .bas file so I can create a VB6 program to run the file. I think this will be easier for everything I need to do because I can then specify the file to import, location and everything else.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

snaayk
Senior Member

USA
1061 Posts

Posted - 30 October 2003 :  15:59:27  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
FYI, you can create a global variable to change the file name & location.
For example:
textfile = "text.txt"
DTSGlobalVariables("filename").value = textfile

You can use FSO to read the variables off of a text file.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.4 seconds. Powered By: Snitz Forums 2000 Version 3.4.07