邹建《中文版SQL Server 2000开发与管理应用实例》新书第427页。。。

qingchunjingwu 2005-09-08 06:01:00
第427页上面有个表格:

表14-4 sp_MSforeachtable、sp_MSforeachdb和sp_MSforeach_worker的参数定义及参数说明

参数定义 描述
@command1 nvarchar(2000) 第1条运行的Transact-SQL语句。sp_MSforeach_worker无此参数


但实际上,我们看系统存储过程sp_MSforeach_worker 的定义是有@command1这个输入参数的。

/*
* This is the worker proc for all of the "for each" type procs. Its function is to read the
* next replacement name from the cursor (which returns only a single name), plug it into the
* replacement locations for the commands, and execute them. It assumes the cursor "hCForEach"
* has already been opened by its caller.
*/
create proc sp_MSforeach_worker
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null, @command3 nvarchar(2000) = null
as

create table #qtemp ( /* Temp command storage */
qnum int NOT NULL,
qchar nvarchar(2000) COLLATE database_default NULL
)
...全文
243 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yc04740163 2005-09-11
  • 打赏
  • 举报
回复
不错不错 很认真嘛!
zjcxc 2005-09-09
  • 打赏
  • 举报
回复
不好意思,这个明显是搞错了, @command1 是必选和最常用的一个
zzxiaoma 2005-09-09
  • 打赏
  • 举报
回复
正常,呵呵
whisht 2005-09-09
  • 打赏
  • 举报
回复
赶紧找来这本书看看去
samfeng_2003 2005-09-09
  • 打赏
  • 举报
回复
是啊!希望皱大哥在二次修订版的时候能增加更多实例,然后改进他的一些问题!期待……但是,怎么样书确实非常实用。
yangys 2005-09-08
  • 打赏
  • 举报
回复
怎么说也是一本非常有价值的书!

11,849

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧