T-SQL:读取磁盘文件

来源:互联网 发布:开淘宝店铺照片怎么拍 编辑:程序博客网 时间:2024/05/19 12:17
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

数据倒入还是建议用bcp

ifexists(select*fromtempdb..sysobjectswhereid=object_id(N'tempdb..#T'))
  droptable[#T]

Createtable#T(idintidentity(1,1)notnull,remarkvarchar(8001)null)
Insertinto#T
Execmaster.dbo.xp_cmdshell'typee:/data.txt'
select*from#T

剩下就靠你自己根据"数据类型" 整理"数据格式"等了.....

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>