Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS and Visual Basic 1

Status
Not open for further replies.

deepsheep

Programmer
Sep 13, 2002
154
CA
I have created a VB module from the DTS wizard. It takes a table and spits out a text file. That part seems to work great, however, the file still need to be manipulated so it can be used in another program.

I currently get the file in the form:
-118.122, 22.122
-112.234, 54.123

and I need it in the form:
point -118.122, 22.122
point -112.234, 54.123

Can this be done within the DTS structure as the file is made or do I need to continue to manipulate the file after it has been created?

Thank You!
 
This can be done using a DTS package, the simplest way is to change the transform data task in your package. Rather than outputting directly from the table use an SQL query similar to this,
Select 'point' Point, A, B from tbl
Which will give you, an additional column word point for every row in your output.
You could also concatenate the word to the first column,
Select ‘point ‘ + A A, B from tbl
Which may be easier but may also require you to cast the column a char or varchar depending on its current data type.
 
I had to do it like this:

Select ("Point " + cast(Column1 as varchar)) as Colmun1, column2 FROM TableName Where ...

Thanks for putting me on the right track!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top