SSIS:尝试将具有1列的平面文件转换为具有2列的表中的2种类型的数据

时间:2017-02-16 15:59:40

标签: sql database ssis ssms-2014

我正在使用SSIS并尝试将包含SSNRN列的平面文件转换为包含2列的表格,其中一列用于SSN varchar(9)RNvarchar(2)1.Select the range of data you want to rearrange, including any row or column labels, and press Ctrl+C. Note: Make sure you copy the data to do this. Using the Cut command or Ctrl+X won’t work. 2.Right-click the first cell where you want to paste the data, and pick Transpose Tranpose button image . Pick a spot in the worksheet that has enough room to paste your data. The data you copied will overwrite any data that’s already there. Paste Options menu 3.After rotating the data successfully, you can delete the original data. Tips for transposing your data If your data includes formulas, Excel automatically updates them to match the new placement. Verify these formulas use absolute references—if they don’t, you can switch between relative, absolute, and mixed references before you rotate the data. If your data is in an Excel table, the Transpose feature won’t be available. You can convert the table to a range first, or you can use the TRANSPOSE function to rotate the rows and columns. If you want to rotate your data frequently to view it from different angles, consider creating a PivotTable so you can quickly pivot your data by dragging fields from the Rows area to the Columns area (or vice versa) in the PivotTable Field List. 。{如何将平面文件拆分为2个单独的列?

1 个答案:

答案 0 :(得分:0)

我明白了。我试图做一个演员,我把它切换到子串。我创建了一个从第一个字符开始并拉出9个字符的表达式。然后我创建了第二个表达式,它将从字符10开始并拉出2个字符。完成后,我进行了数据转换,将它们切换为字符串。

SUBSTRING([SSN      RN],1,9)
SUBSTRING([SSN      RN],10,2)

作业成功,并作为2个单独的列

导入到表中