The Script task can use the Log method of the Dts object to log user-defined data. If logging is enabled, and the ScriptTaskLogEntry event is selected for logging on the Details tab of the Configure SSIS Logs dialog box, a single call to the Log method stores the event information in all the log providers configured for the task.
Loging is enabled and ScriptTaskLogEntry is selected:
Dim emptyBytes(0) As Byte
Dts.Log("TotalRecords: " + Dts.Variables("User::NoForCheck").Value.ToString, 0, emptyBytes)
Dts.Events.FireError(0, "", "Can not find the source file!", "", 0)
Dts.TaskResult = Dts.Results.Failure
User:ScriptTaskLogEntry,,,24/10/2012 3:16:22 PM,24/10/2012 3:16:22 PM,0,0×00,TotalRecords: 27
Logging in the Script Task
It’s really ridiculous that we cannot sort the files in SSIS project in BIDS.
fortunately, we got a plug-in named ‘BIDS Helper’, which has a feature called ‘Sort Project Files’:
Sort Project Files
This feature adds a “Sort by name” menu option to the “SSIS Packages” folder of an SSIS project in Visual Studio:
This feature is implemented natively in BIDS in SQL2008.
Links:Database; Tagged with: SQL • SQL Server; @ October 17th, 2012 12:20
Grant user permission to login to the database:
CREATE USER ROA_NAME FOR LOGIN ROA_NAME
Add user to the group:
EXEC SP_ADDROLEMEMBER 'DB_DATAREADER', 'ROA_NAME'
“Members of the db_datareader fixed database role can run a SELECT statement against any table or view in the database.”
更详细的参考：Database; Tagged with: ETL • SQL • SQL Server • SSIS; @ October 9th, 2012 20:11
First we need to Config logging in SSIS package(GUI):
Two methods to generate the log:
dtexec /f DavidTest.dtsx /l “DTS.LogProviderTextFile;log.txt”
(log.txt is a Connection in SSIS package).
dtexec /f DavidTest.dtsx /cons NMT >C:/ConsoleMsg.log
About the dtexec parameters:
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.