简体   繁体   English

区分大小写的SSIS

[英]Case Sensitive SSIS

In our environments, sometimes the case changes. 在我们的环境中,情况有时会发生变化。 Id becomes ID and then morphs into id. id变成ID,然后变身为id。

When this happens, my SSIS packages (sql server 2008) fail because the column name is not the same case as expected. 发生这种情况时,我的SSIS包(SQL Server 2008)失败,因为列名与预期的大小写不同。

Here is a way to reproduce the problem. 这是重现该问题的一种方法。 In your Dev SQL Server, create the following tables: 在您的Dev SQL Server中,创建下表:

DROP Table dbo.CartoonCharacters
Go
Create Table dbo.CartoonCharacters
(
    CartoonCharacterID  INT,
    CartoonCharacterName    VarChar (100)
)

DROP Table dbo.ToonCharacters
Go
Create Table dbo.ToonCharacters
(
    ToonCharacterID INT,
    ToonCharacterName   VarChar (100)
)

INSERT INTO dbo.CartoonCharacters VALUES 
 (1, 'Don Duck')
,(2, 'Mike Mouse')
,(3, 'Rog Rabbit')
GO

Create a SSIS package with a single Data Flow Task to which add an OLE DB Source that points to CartoonCharacters and an OLEDB Destination that points to ToonCharactes and connect the green arrows and do the column mapping. 使用单个数据流任务创建一个SSIS包,向其中添加指向CartoonCharacters的OLE DB源和指向ToonCharactes的OLEDB目标,并连接绿色箭头并进行列映射。

Run the package and 3 rows are transferred. 运行该程序包,并传输3行。

Now, in SSMS, change CartoonCharacterID to cartooncharacterid (all lowercase). 现在,在SSMS中,将CartoonCharacterID更改为cartooncharacterid(全部小写)。

Try to run the package again. 尝试再次运行该程序包。 It bombs. 它炸弹。 :( It says VS_NeedNewMetadata. This is, of course, because the CASE changed. :( :(它表示VS_NeedNewMetadata。当然,这是因为CASE已更改。:(

Is there a way to make SSIS package metadata case insensitive? 有没有办法使SSIS包元数据不区分大小写?

You can work around changing case on the base tables by getting data from 您可以通过从

  1. View on the table 在桌子上查看
  2. A SQL statement that lists the columns. 列出列的SQL语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM