http://www.robsymonds.com/ssis-output-to-multiple-files/
http://www.sqlservercentral.com/Forums/Topic577774-148-1.aspx
http://www.cozyroc.com/script/get-ftp-file-list-task
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=76989
Foreach Loop Container
Foreach ADO Enumerator
User::a
vCol
vVal
a
Full result set
select col, val from tbale
ResultSet User::a 0
ReadOnlyVariable User::vCol,User::vVal
Input and output: col1,col2
public override void CreateNewOutputRows()
{
/*
Add rows by calling the AddRow method on the member variable named "Buffer".
For example, call MyOutputBuffer.AddRow() if your output was named "MyOutput".
*/
Output0Buffer.AddRow();
Output0Buffer.col = Variables.vCol;
Output0Buffer.val = Variables.vVal;
}
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
/*
Add your code here
*/
string fileLoc = @"c:\" + Row.col;
FileStream fs = null;
if (!File.Exists(fileLoc))
{
using (fs = File.Create(fileLoc))
{
fs.Write(System.Text.Encoding.Default.GetBytes(Row.val), 0, Row.val.Length);
}
}
else
{
using (StreamWriter sw = new StreamWriter(fileLoc))
{
sw.Write(Row.val);
}
}
}
'
' Add your code here
'
Dim DestFileName As Variables
Dim DestPath As Variables
Dim strTargetFile As String
Dim strSelectSQL As String
Dts.VariableDispenser.GetVariables(DestPath)
Dts.VariableDispenser.LockForRead("User::DestFileName")
Dts.VariableDispenser.GetVariables(DestFileName)
strSelectSQL = "select XmlContent,XMLFileNumber from WeijunHe.dbo.LocalXML where XMLFileName = '" & DestFileName(0).Value.ToString & "'"
Dts.Variables("User::SelectSQL").Value = strSelectSQL
DestFileName.Unlock()
End Sub
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7899089/viewspace-707210/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7899089/viewspace-707210/