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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Transaction Service and "fixed fields" text file as destination

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I try to use Data Transaction Service (SQL Server 7) to copy information from an Sql Server Table to an text file (fixed field). When I run the process, no problem, the text file is created and a Ok message appears. But when I look in my text file, every time a field was NULL or empty in the source table, the following fields are not aligned !

Somebody knows what the problem ?

Thanks

Vincent

Ps: I'm french so excuse me for my english
 
DTS skips Null columns. You can solve this in several ways.
[ol][li]Create a view of the table and for every nullable column include the IsNull function to convert Nulls to empty strings.

Select
field1,
field2=isnull(field2,''),
field3=isnull(field3,''),
field4, ...
From table

Use DTS to export from the view rather than the table.

[li]In DTS use a query as the source of the data. The query would be like the view described above.

[li]Use VB Script to transform the data during the DTS transfer.[/ol] Terry
_____________________________________
Man's mind stretched to a new idea never goes back to its original dimensions. - Oliver Wendell Holmes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top