help! with data formatting

  •  

    I am coverting/mapping VMS/RMS data to MSSQL. To compose the data map I need to get the data from the database row format such as

    field, field1, field2, field3

    To a text file:

    field

    field1

    field2

    field3

    This will surely have a follow up post since there are a few tables that will end up making up the text file but an answer to this may give me enough of a kick start to allow me to do the rest.

    Regards, Jeff

     

     

     

     

     

  • Can't you use the new pivot option
     
     
    USE AdventureWorks;GOSELECT VendorID, [164] AS Emp1, [198] AS Emp2, [223] AS Emp3, [231] AS Emp4, [233] AS Emp5FROM (SELECT PurchaseOrderID, EmployeeID, VendorIDFROM Purchasing.PurchaseOrderHeader) pPIVOT(COUNT (PurchaseOrderID)FOR EmployeeID IN( [164], [198], [223], [231], [233] )) AS pvtORDER BY VendorID

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply