etl

convert Excel Date Serial Number to Regular Date

我与影子孤独终老i 提交于 2019-11-26 20:26:39
I got a column called DateOfBirth in my csv file with Excel Date Serial Number Date Example: 36464 37104 35412 When i formatted cells in excel these are converted as 36464 => 1/11/1999 37104 => 1/08/2001 35412 => 13/12/1996 I need to do this transformation in SSIS or in SQL. How can this be achieved? Nick.McDermaid In SQL: select dateadd(d,36464,'1899-12-30') -- or thanks to rcdmk select CAST(36464 - 2 as SmallDateTime) In SSIS, see here http://msdn.microsoft.com/en-us/library/ms141719.aspx Jacob Santiago The marked answer is not working fine, please change the date to "1899-12-30" instead of

「数据ETL」从数据民工到数据白领蜕变之旅(三)-除了Excel催化剂之外PowerQuery新物种同样值得期待

半腔热情 提交于 2019-11-26 19:51:49
在自助式BI时代以前,Excel级别的数据ETL工作,非常低效,动不动就要启用VBA来完成一些常见的需求,自带的原生功能,未能满足大量的繁琐数据ETL刚需功能。 在Excel2010后,PowerQuery以插件的形式横空出现,并最终在Excel2016中得以深度内置,是一款非常难得的轻量化数据ETL工具。 微软官方插件与第三方插件待遇不同 在使用第三方插件的过程中,可以弥补一些数据处理的刚需,但因每个插件的定位及用途不一,暂没有发现哪个像Excel催化剂这样专注做一些高阶的应用,同时第三方插件的使用体验,略低于原生的功能(需要安装、发布、分享等环节麻烦,同时界面操作没法做到原生那般地紧密相联) 在PowerQuery方面,其因是官方的插件,就算在Excel2010或Excel2013中使用,无论安装的成功率保障还是和原生功能的内置方面,都比我们第三方插件要强得多,同时也更容易过IT审核的关卡,毕竟是官方的插件,肯定对电脑没什么病毒后门式的顾虑。 PowerQuery一个很深入的集成性在于,其数据加载的过程中,原生地开发其以Excel智能表的形式加载出来,并且以数据连接的方式和源数据和加工过程相连接,所以非常好的体验在于数据源更新后,只需刷新一下结果表即可按原来配置过的逻辑对数据进行更新。 在第三方插件中,这个过程肯定需要重新在界面上重来一遍

「数据ETL」从数据民工到数据白领蜕变之旅(四)-有了PowerQuery还需要SSIS吗?

馋奶兔 提交于 2019-11-26 19:51:46
在真正的企业级BI项目中,使用PowerBIDeskTop那一套数据ETL是不可行的,需要使用专业的ETL工具完成数据仓库的搭建,再进行数据建模的工作。 鉴于笔者所能触达的读者群体,多数为业务背景的数据分析工作者,本篇给大家带来简单的入门实操演示,让大家减少对专业IT型工具的恐惧心理。 所有工具都是为人所用,都是想着尽可能简单易上手的,学习过PowerQuery的群体,笔者很有信心只需跨出信心的一步,SSIS掌握到够用的级别还是很容易实现的。 PowerQuery的局限性 作为一款自助式BI的轻量ETL工具,PowerQuery的确可以让我们享受许多数据处理的便利,无需专业的能力,大部分仅需通过界面的操作即可完成,无可否认PowerQuery的使用体验是非常棒的。 甚至很多在SSIS这样专业级ETL工具上实现起来繁琐的任务,在PowerQuery上可以非常流畅地完成如逆透视,简单网页抓取,空值填充,行列转置等。 但PowerQuery的局限性也是非常明显的。 首先,它的性能是非常容易出现瓶颈的,虽然数据处理逻辑很清晰,但就是要忍受漫长的等待时间,很多时候,数据量级别稍大一些,单单这点就要否决使用PowerQuery方案。 其实,对某些数据ETL它是有缺陷的,例如不能扩展性地使用正则表达式处理字符串数据; 最后,它很大的弊端是目标数据只能进入到PowerPivot层面

「数据ETL」从数据民工到数据白领蜕变之旅(五)-使用dotNET脚本实现SSIS无限扩展

徘徊边缘 提交于 2019-11-26 19:51:37
在前面一文中,正式引出了SSIS专业数据ETL工具,笔者仅能作引路作用,未能使用文章的方式给大家写出更多的入门级的文章,希望读者们可以自行根据分享的学习资源自行完成入门及进阶的学习。 同时也想给大家分享到SSIS的能力边界性,让大家可以先打开思路,见识到其能力的所在,日后在学习过程中,可以有更清晰的进步方向。 dotNET遇上SSIS 在笔者过往的文章里已经反复提到过,学习dotNET的性价比是比较高的,不止于可以做任何专业程序员做的领域,更是可以让我们这些业余的人员大有作为,例如可以开发OFFICE插件,可以使用PowerShell来做运维(会dotNET的很快上手,都是广义的dotNET体系),同时在微软的产品系里开放了各产品的对象模型,使我们可以轻松地和各大产品作交互如Windows的WMI模型,Sqlserver的SMO、AMO模型,当然还有我们熟悉的OFFICE对象模型等。 今天来到SSIS中,我们可以有另外一层能力,让dotNET和SSIS集成,在SSIS中,提供了VSTA的开放接口(Visual Studio Tools For Application),相对于VSTO(Visual Studio Tools For Office)来说,一个是对OFFICE产品,一个是对程序,这里的程序就是SSIS。 所以我们可以在SSIS环境下使用dotNET语言

What's the most efficient way to convert a MySQL result set to a NumPy array?

▼魔方 西西 提交于 2019-11-26 14:08:47
问题 I'm using MySQLdb and Python. I have some basic queries such as this: c=db.cursor() c.execute("SELECT id, rating from video") results = c.fetchall() I need "results" to be a NumPy array, and I'm looking to be economical with my memory consumption. It seems like copying the data row by row would be incredibly inefficient (double the memory would be required). Is there a better way to convert MySQLdb query results into the NumPy array format? The reason I'm looking to use the NumPy array format

Import Excel spreadsheet columns into SQL Server database

二次信任 提交于 2019-11-26 12:52:13
I have an Excel spreadsheet that I want to import select columns into my SQL Server 2008 database table. The wizard didn't offer that option. Do any easy code options exist? Once connected to Sql Server 2005 Database, From Object Explorer Window, right click on the database which you want to import table into. Select Tasks -> Import Data. This is a simple tool and allows you to 'map' the incoming data into appropriate table. You can save the scripts to run again when needed. Microsoft suggest several methods: SQL Server Data Transformation Services (DTS) Microsoft SQL Server 2005 Integration

SSIS Source Format Implicit Conversion for Datetime

眉间皱痕 提交于 2019-11-26 11:40:58
问题 Does anyone know of a chart that shows which formats of dates are supported by the different datatypes in SSIS? For example, does DT_DBTimestamp support the format 1-Jan . I tried looking but couldn\'t find anything. The reason I ask is that I found that when I try to do a Convert(datetime, \'1-Jan\') it fails which I expected. However, when I pull this same value into SSIS into the DT_DBTimestamp , it will implicitly identify it as 1/1/2017 rather than redirect the row as a datatype

Importing excel files having variable headers

孤街醉人 提交于 2019-11-26 09:59:33
问题 I have the SSIS package, which will load the excel file into Database. I have created Excel Source task to map the excel column name to Database table column name and its working fine. In rare case, We are receiving the excel file column name with some space (for example : Column name is \"ABC\" but we are receiving \"ABC \") and which cause the mapping issue and SSIS got failed. Is there any possible to trim the column name without opening the excel. Note : Page name will be dynamic and

Copy a few of the columns of a csv file into a table

妖精的绣舞 提交于 2019-11-26 08:05:41
问题 I have a CSV file with 10 columns. After creating a PostgreSQL table with 4 columns, I want to copy some of 10 columns into the table. the columns of my CSV table are like: x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 the columns of my PostgreSQL table should be like: x2 x5 x7 x10 回答1: If it is an ad hoc task Create a temporary table with all the columns in the input file create temporary table t (x1 integer, ... , x10 text) Copy from the file into it: copy t (x1, ... , x10) from '/path/to/my_file' with

Import Excel spreadsheet columns into SQL Server database

拈花ヽ惹草 提交于 2019-11-26 03:08:26
问题 I have an Excel spreadsheet that I want to import select columns into my SQL Server 2008 database table. The wizard didn\'t offer that option. Do any easy code options exist? 回答1: Once connected to Sql Server 2005 Database, From Object Explorer Window, right click on the database which you want to import table into. Select Tasks -> Import Data. This is a simple tool and allows you to 'map' the incoming data into appropriate table. You can save the scripts to run again when needed. 回答2: