COM and its successor. Net have a feature that can be repeatedly written in other languages.ProgramSet. In SQL Server 2005, only VB. NET can be used for script tasks. Here, we can use an assembly written in any. NET language.
Use the Assembly to reuse the already writtenCodeYou may have written the data verification method in your program. Now you can reuse the code in the package. Writing the tested code again is meaningless.
To use an assembly in your own code, you need to reference it first. We need to put the Assembly in an available path and ensure that the. NET Framework is installed on the machine where it is located.
Add an assembly in the Visual Studio editing environment. In the project menu, select Add reference, 1.
Figure 1
Select the assembly to be added from the list, and click OK to add the assembly to the project. In this way, all the methods in the Assembly can be used.
To delete an assembly, right-click the added assembly and right-click Remove.
We wrote a helloword package, which contains only one script task, which completes a simple task. Replace this program with an assembly, and use the program and implementation.