(高分求援)关键词:存储过程,水晶报表,参数!

zybhappy 2003-08-22 12:47:58
我想用带参数的存储过程作为水晶报表的数据源,参数为表名,存储过程如下,各位大虾,解决问题马上给高分!
存储过程如下:

ALTER PROCEDURE dbo.m_forprint
(@tname char(10))
AS
declare @sqls char(256)
set @sqls='select t_xuesheng.xingming ,cometime ,leavetime , stat= case stat when ''1'' then ''迟到'' when ''2'' then ''早退'' when ''3'' then ''迟到早退'' when ''4'' then ''旷工'' when ''0'' then ''正常'' end from ' + rtrim(@tname) +',t_xuesheng where '+ @tname+'.xuehao=t_xuesheng.xuehao'
exec (@sqls)
RETURN

其中,t_xuesheng 为表,字段xingming,xuehao,作为参数的@tname ,包含字段xuehao
...全文
20 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zybhappy 2003-08-28
  • 打赏
  • 举报
回复
up it myself

16,552

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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