|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-05-25 : 08:40:15
|
| Steve writes "I have a table called PTT_ExternalData(DataID INT Primary,SourceID INTColumName NVARCHAR 255,ColumnValue NVARCHAR 255)I want to run a DTS that uses a txt file.The first 4 lines of this txt including column names are:"EstimateNumber","ProjectNum","ProjectName","Address","City","State","Zip","ProjectGrouping","DeliveryType","ProjectStatus","ProjectType","Treatment","CostGroup","BOMCatalog","ProjectManager","Contractor","SiteRelease","ReleasedToSurveyor","HasSurvey","SurveyCompleted","HasJobberMID","MID1IssueDate","MID1ApprovalStatus","MID2IssueDate","MID2ApprovalStatus","MID3IssueDate","MID3ApprovalStatus","HasBOM","BOMRevision","BOMRevisionDate","BOMApprovedStatus","BOMResponderDate","JobberBookComplete","EstCompleteMaterialsDelivered","ActCompleteMaterialsDelivered","EstStartConstruction","ActStartConstruction","ActCompleteConstruction","ProjectSignoff","ProjectCloseout","SitePutOnHold","SiteCancelled","TreatmentLevelChanged","HasPO","POCount","POTotal","HasSubcontract","SubcontractCount","SubcontractTotal","ApprovedBudget","TotalProjectSpend","OCOLaborTotal","OCOMaterialTotal","OCOTotal""","0005","Mark's Test Project #25","Amoco Station 10 Burbon Street","Somewhere","NJ","99999","","JO-Bob Coffey","Materials Only","ECBU-S -- Dothan","","","","","","No","","No","","","","","","","No","","","No",0,"No",0,0 "","440NewBuildEurope","New Build - Europe","New Build - Europe","","","","","","Released for Survey","","","","","","","No","","No","","","","","","","No","","","No",0,"No",0,0 "","50100000","DCA-General","","","","","","","","","","","","","","No","","No","","","","","","","No","","","No",0,"No",0,0 I want to add a row in PTT_ExternalData for each item in this list with the SourceID to default to 1. So that means I need to strip out the Column Headings and somehow use them as Global Variables so that they match for each row, and loop through all rows.This is causing me many headaches, please help.Thanks" |
|