W3CHINA Blog首页    管理页面    写新日志    退出


«December 2025»
123456
78910111213
14151617181920
21222324252627
28293031

 

公告

Back Today!

Hold on~ 

Come on~

最新日志

正规判断email
文件md5值
javascript:操作url参数的函
C#淡出淡入窗体
VSS 6 admin用户的密码破解
没用过的东东(sql)
初学ajax(C#)
页面开发的准则一
textbox忽略html验证
这点破东东,老是记不住,nnd!

最近的评论

回复:初学ajax(C#)
回复:C#淡出淡入窗体
回复:ivr的部分动作
回复:textbox忽略html验证
回复:VSS 6 admin用户的密码破
回复:VSS 6 admin用户的密码破
回复:VSS 6 admin用户的密码破
回复:VSS 6 admin用户的密码破
回复:excel中的工作表名sheetn
回复:VSS 6 admin用户的密码破

连接




专题

首页(39)
IVR(4)
SQLSERVER(12)
AJAX(0)
.net(13)
小技巧(4)
english(2)

留言

签写新留言

请教

统计

blog名称:执著
日志总数:39
评论数量:43
留言数量:0
访问次数:247564
建立时间:2005年3月4日

[SQLSERVER]公司用的,分号码的一个存储过程
执著 发表于 2005/4/7 10:38:19

ALTER      proc division@infile varchar(1000),--源文件完整路径@out varchar(1000),   --目的文件夹(必须存在)@outfile varchar(1000),--目的文件名@num int =30000 --分成多少个一份as set nocount on declare @cmd varchar(2000)declare @count int if exists(select * from tempdb.dbo.sysobjects where name = '##temp' and xtype = 'U')begin drop table ##tempend create table ##temp(Col001 nvarchar(4000)) set @cmd = 'bcp ##temp in ' + @infile + ' -c -P'exec master..xp_cmdshell @cmd select identity(int,1,1) as no,Col001 into #temp from ##temp select @count =count(*) from #tempdeclare @ide int set @ide = 1while @count != 0begin set rowcount @num select * into ##t1 from #temp order by no set @cmd = 'bcp "select Col001 from ##t1" queryout "'+@out +'\'+@outfile+'_'+cast(@ide as varchar(4)) +'.txt" -c -P' exec master..xp_cmdshell @cmd  delete from #temp where no in (select no from ##t1) drop table ##t1 set @ide = @ide +1 select @count = count(*) from #temp set rowcount 0endset nocount off

阅读全文(2065) | 回复(0) | 编辑 | 精华


发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



 

 

 


站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.386 second(s), page refreshed 144801403 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号