????? ????? ????????? ??? ??? ????? ??????? ???????? ???? ???????? ??? ?? ???? SQL Server 2005 ????? Services

?????? ????????? ?????? ?????????
???? ???????: 906560 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

??? ??????? Microsoft SQL Server ????? ???? ????? Studio ?????? ???? Microsoft SQL Server 2005 ????? ????? (SSIS) ???? ?? ????? ???? ???????? ??? ?? ???? SSIS ?????? ????.

??? ???? ??????? ?? ??????? ?????? ?????? ?? ????????? ????? ??? ??? ????? ??????? Windows. ????? ????? ???? SSIS ????? ??? ???? "???? ????????". ????? ??? ?????? "???? ????????" ????? "??? ??????". ????? ??????? ???? Script ????? ???????? ???? ?? ????? ??? ??????? "??? ??????" ??? ??? ????? ??????? Windows.

???? ??? ??????? ????? ??????? ???? Script ?????? ??????? ??? ??? ????? ??????? Windows.

??????? ????

??? ???? ??? ??? ?????? ??????? ??????? ?? ???? SSIS:
  • ???????? ???? ???
  • ???? Script
  • ???? ?? ?????? "???? ????????" ??? ?????? Script
  • ?? ?????? "???? ????????" ????? ????? "??? ??????" ?? ???? ????????.
??? ????? ?????? "??? ??????" ??????? ???? ?????? ???????? ??? ?????? ???? ???? ?? ??????? ??? ??? ????? ??????? Windows.

?????? ????? ???? ??????? ??????? ?? SQL Server Studio ????? ???? ???????:
  1. ????? ???? ????? ??????? ???? ?????? ???? ??? ?????? ?????? ??? ??? ??????? ??? ?? ???? ??? ???????. ???? ???? ??????? ?? ????? ??????.
  2. ?? ?????? "?????????" ? ???? ??? ????? ????? ?????? ????? ???? ????? mycount. ??? ?????? ????? mycount ???? ???? ??????? Int32.

    ?????? ????? ??? ????? ????????? ????? ????? ??????.
  3. ???? ????? ??????? ??? ?????? ???? ????????. ???? ????? ??????? ???? ????????.
  4. ???? ????? ??????? ??? ????? ??? ??????. ???? ???? ?????? ???? ?????.
  5. ????? ???? ??????? VariableName ??? mycount.
  6. ???? ??? ????? ??????? ???? ??? ?? ???? ????? ??????? ??? ?????? ???????? ?????. ???? ???? ?????? Script Editor ??????.
  7. ???? ??? ?????? Script ?? ????? ?????? ?? ?? ?????? ???? ??????? ReadOnlyVariables ??? ?????? ???????: PackageName ??????
    PackageName,StartTime,ExecutionInstanceGUID,mycount
    StartTime ?????? ExecutionInstanceGUID ??????? ??????. ??? ??????? ??? ????????? ?????? ?????? ??????? ?????? ??? ??? ????? ??????? Windows.
  8. ?? ???? ?????? Script Editor ?????? ? ???? ??? ?????? ???????.
  9. ???? ?? ?? ?????? ?????? ??????? ??????? ?? ????????? ???????? ??? ?? ????????? ??????:
    Imports System
    Imports System.Data
    Imports System.Math
    Imports System.Diagnostics
    Imports Microsoft.SqlServer.Dts.Runtime
  10. ????? ???? ???? Microsoft Visual Studio ????????? ???? ??????? ????? ????????? ???????? ??????? ?? ????? ?? ????? Main(). varMyCount
    	Dim varMyCount As Variable = Dts.Variables("mycount") '
    	Dim varPackageName As Variable = Dts.Variables("PackageName")
    	Dim varStartTime As Variable = Dts.Variables("StartTime")
    	Dim varInstanceID As Variable = Dts.Variables("ExecutionInstanceGUID")
    	Dim PackageDuration As Long
    
    	'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    	' Event log needs
    	'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    	Dim sSource As String
    	Dim sLog As String
    	Dim sEventMessage As String
    	Dim sMachine As String
    	'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    
    	PackageDuration = DateDiff("s", varStartTime.Value, Now())
    
    	sSource = "RowCountReporting from SSIS"
    
    	' We need the message posted to the Application event log.
    	
    	sLog = "Application"
    	sEventMessage = "Rows Processed: " & Chr(10) _
    	& "     case Rows:" + varMyCount.Value().ToString + Chr(10) _
    	& "=============================================" & Chr(10) _
    	& "The Package: " + varPackageName.Value().ToString _
    	& Chr(10) _
    	& "Started: " & varStartTime.Value().ToString _
    	& Chr(10) _
    	& "Current Time:" & System.DateTime.Now _
    	& Chr(10) _
    	& "=============================================" _
    	& Chr(10) _
    	& "Package Run Duration in seconds: " & PackageDuration _
    	& Chr(10) _
    	& "Execution GUID: " & varInstanceID.Value().ToString
    	sMachine = "."
    
    	If Not EventLog.SourceExists(sSource, sMachine) Then
    	    EventLog.CreateEventSource(sSource, sLog, sMachine)
    	End If
    
    	Dim ELog As New EventLog(sLog, sMachine, sSource)
    
    	ELog.WriteEntry(sEventMessage, EventLogEntryType.Information, 777, 2)
    
    	'###############################
    	Dts.TaskResult = Dts.Results.Success
  11. ????? ???? Microsoft Visual Studio ??????.
  12. ?? ???? ?????? Script Editor ?????? ? ???? ??? "?????".
  13. ???? F5 ????? ??????.
??? ????? ?????? ?????, ???? ??????? ?????? ??????? ??????? ?? ??? ????? ??????? Windows:

??? ?????: ???????
???? ?????: RowCountReporting ?? SSIS
??? ?????: ?????
????? ?????: 777
?????: 8/10/2005
?????: 11:30:51 ?
????????: N/A
ComputerName ?????????:
?????:
?????? ???? ??? ????????:
??????: 3 ????
=============================================
??????: RowCountsInEventLog
??? ?????: 14 9 2005 2:27:19 ?
?????: 9/14/2005 2:27:19 ?????? ?
=============================================
???? "????? ?????" ????????: 0
????? GUID: {07406D68-487F-4733-BA3A-DA66A8AF7EFA}

????? ?? ?????????? ???? "????????? ??????" ?? http://support.microsoft.com.

?????

????? ?? ?????????? ???? ???????? ??????? ?? Microsoft SQL Server 2005 ????? ????:
  • ?????? ???????? ?????
  • ????? ?????? Script
  • ?????: ????? ????? ?????? ???????? ???? ??????
?????? ??? ???? ?? ????????? ??? ????? ??????? ??? ??? ????? ??????? Windows ???????? Microsoft Visual Basic ?? ?????? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn.microsoft.com/en-us/library/07347hdt.aspx

???????

???? ???????: 906560 - ????? ??? ??????: 29/?????/1427 - ??????: 3.2
????? ???
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard Edition
????? ??????: 
kbmt kbsql2005ssis kbhowto KB906560 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????906560

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com