English 中文(简体)
将日期格式从DDMMYYYYYYY改为MMDDYYYYYYY
原标题:convert date format from DDMMYYYY to MMDDYYYY in SSIS

I am trying to insert a date value in the format of mmddyyyy to SQL Server. In my source .csv file its in the format ddmmYYYY. Is it possible to insert a datefield to SQL Server in this format?

Thanks...

问题回答

In the dataflow add a derived column transformation. Create a new derived column and change its expression to

(DT_DBTIMESTAMP)(SUBSTRING(TextDate,7,4) + "-" + 
    SUBSTRING(TextDate,1,2) + "-" + SUBSTRING(TextDate,4,2))

然后,你可以把这栏图上放在你的服务器的目的地一栏。

将数据流转换成<代码>Data换算<>/code>并选择<代码>DT_DATE为产出类型。

输入量(摘自您的Excel文档)将转换为迄今为止的物体(如果您的表列没有按日期分类)。

否则,你可以增加数据流变式<代码> 封面部分,以便按要求使用C#......加以压缩和改造。





相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

SQL server: Can NT accounts be mapped to SQL server accounts

In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签