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

exporting duplicate column data

Status
Not open for further replies.

alfie002

Technical User
Mar 3, 2004
121
GB
Hello all,

I need to export data from a MS SQL server. I am using the export wizard to do so. However,I need to export mutliple instances of the same columns. EG


datetime, ps, recnum, customer, ps, count, probe, count

Using the standard query builder I am not able to select mulitple like columns. Equally, using a custom query I still cannot do this. Does MS SQL (select command) support the ability to select multiple columns ?

Thanks

Alf
 
Try to give different names for the same fields.
Code:
select datetime, ps, recnum, customer, ps as ps2, count, probe, count as count2
 
Hello Otto,

thanks for the response. Much appreciated.

Otto, is there a way to select to columns, append them together and export as one column?

EG:

Column column
servicename Target

The output being:

servicename_target

Thanks


Alf

 
Code:
Select servicename + '_' + target from Table

-------------------------------------------------------------------------------------------------------------------------
"Now I can look at you in peace; I don't eat you any more." Franz Kafka, while admiring fish in an aquarium
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top