Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Results Output Format
Message
De
30/05/2007 21:49:08
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Divers
Thread ID:
01229346
Message ID:
01229488
Vues:
8
> I only have to create those flat files one time.

Query Analyser can export tab-separated files ok. Set "Results to Grid", run your query, then right-click on the grid and select "Save As..". At the bottom of the dialog you can select tab as the delimiter. In fact, although it looks like a drop down list, you can enter any delimiter character you like, eg a '|' pipe.

Query Analyser isn't very flexible with output formats. It claims to write CSV, but actually it writes 'delimited with comma' - it doesn't include column headings, and it doesn't put quotes around strings.

In truth for a job like this I'd probably use FoxPro...
h = sqlstringconnect( 'driver={sql server}......' )
Sqlexec( h, 'select * from ....' )
copy to .... type csv
Or use Excel, or OpenOffice Base/Calc, or...

Excel will munge strings that look like dates, or look like numbers (classic example in New Zealand is phone numbers, which often have a leading zero, eg 0800-something for a toll-free number, 021 or 027 for a mobile). OpenOffice Calc is a little bit better.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform