惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
J
Java Code Geeks
L
LangChain Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
博客园 - Franky
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
博客园 - 司徒正美
B
Blog
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
Engineering at Meta
Engineering at Meta
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog

博客园 - Steven.zhou

Setting Up Database Mirroring Using Certificates get the server's infomation sql 2005数据库加密实战 Raid(0,1,5,10,01) SQL Server 2005高可用性之镜像功能(http://tech.it168.com/db/s/2007-04-24/200704240837593.shtml) SQL Server 2005高可用性之复制(http://tech.it168.com/db/s/2007-05-15/200705150909375.shtml) SQL Server 2005高可用性之日志传送(http://tech.it168.com/db/s/2007-06-29/200706291229796_2.shtml) SQL Server 2005性能测试实践(读书笔记翻译http://www.testage.net/TestTech/PT/200702/1510.htm) Troubleshooting the Performance of a SQL Server Solution(读书笔记,全是copy原文的) 如何缩小SQL Server数据库日志文件 SQL Server一个特殊查询(http://searchdatabase.techtarget.com.cn/tips/206/2295706.shtml) sql server 2005几个好用易忘的功能 查看数据表的大小 Use Table-Valued Functions as Arrays in SQL Serve 在sql server 中如何移动tempdb到新的位置 动态sql语句返回值 得到所有的触发器(含DDL触发器) 得到数据库中所有用户表的字段、数据类型 在sql2005 中Execute的增强
在SSIS中使用自定义的DLL文件
Steven.zhou · 2007-05-31 · via 博客园 - Steven.zhou

步骤
1、开发dll(需要签名)

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Schema;


namespace ETLXmlParser
{
    
public class ETLXmlParser
    
{
        
private static bool isValid = true;

        
public static bool Validate(string XmlFilepath, string XsdFilePath)
        
{
            
try{
            XmlReader reader;
            XmlReaderSettings settings 
= new XmlReaderSettings();
            XmlSchemaSet schemaSet 
= new XmlSchemaSet();
            schemaSet.Add(
null, XsdFilePath);
            settings.Schemas.Add(schemaSet);
            settings.ValidationType 
= ValidationType.Schema;

            settings.ValidationEventHandler 
+= new ValidationEventHandler(settings_ValidationEventHandler);
            settings.ValidationFlags 
= XmlSchemaValidationFlags.ReportValidationWarnings | XmlSchemaValidationFlags.ProcessInlineSchema | XmlSchemaValidationFlags.AllowXmlAttributes | XmlSchemaValidationFlags.ProcessIdentityConstraints | XmlSchemaValidationFlags.ProcessSchemaLocation;
            reader 
= XmlReader.Create(XmlFilepath, settings);
            
while (reader.Read())
            
{
                
string xmlFile = reader.Value;
            }

            reader.Close();
            
return isValid;
            }

            
catch(Exception ex)
            
{
                
return false;
            }

        }


        
private static void settings_ValidationEventHandler(object sender, ValidationEventArgs e)
        
{
        
            isValid 
= false;
        }

    }

}

2 将编译好的dll拷贝到C:\Program Files\Microsoft SQL Server\90\DTS\PipelineComponents(SQL Server 安装目录)和C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
3、将DLL拖进C:\WINDOWS\assembly文件夹,也可以用命令安装该dll(gacutil.exe /i myassembly.dll)
4 在SSIS中拖入一个Script Task,然后设计脚本,添加应用dll