T-SQL: 读取磁盘文件

数据倒入还是建议用 bcp

if exists (select * from tempdb..sysobjects where id = object_id(N'tempdb..#T'))
   drop table [#T]

Create table #T(id int identity(1,1) not null, remark varchar(8001) null)
Insert into #T
Exec master.dbo.xp_cmdshell 'type e:/data.txt'
select * from #T

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

posted @ 2004-09-30 13:39  于斯人也  阅读(172)  评论(0编辑  收藏  举报