将txt插入SQL Server

时间:2015-11-28 21:33:01

标签: sql-server tsql import

我想在SQL Server 2014中添加一个txt文件用于分析目的。 下面是txt文件的一行,来自MixPanel。

{"event":"Search","properties":{"time":1445126437,"distinct_id":"S182248485740","$browser":"Chrome","$browser_version":46,"$city":"Hartlepool","$current_url":"https://flat-club.com/","$initial_referrer":"https://www.google.co.uk/","$initial_referring_domain":"www.google.co.uk","$lib_version":"2.7.1","$os":"Windows","$referrer":"https://www.google.co.uk/","$referring_domain":"www.google.co.uk","$region":"Hartlepool","$screen_height":768,"$screen_width":1366,"$search_engine":"google","ABtesting":"B","Check in date":"(21-10-2015)","Check out date":"(24-10-2015)","LoggedIn":false,"Search Location":"London, United Kingdom","Source":"homepage","Type of Stay":"Holiday","mp_country_code":"GB","mp_lib":"web"}}

我必须在SQL Server导入向导中选择哪些选项才能插入它们?我可以手动替换{等,但我有一个无法打开的2GB文件。

1 个答案:

答案 0 :(得分:0)

我找到了上述软件的解决方案。这些行是Json格式的。我会尝试将它们插入到SQL服务器中。

http://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=json-source.htm