表变量可以做为存储过程的输入或输出参数吗? 表变量可以做为存储过程的输入或输出参数吗?若可以请给个实例,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 create proc sp_test1@tb_name varchar(20)as exec('select * from ' + @tb_name +';')gouse pubsexec sp_test1 'jobs'job_id job_desc min_lvl max_lvl ------ -------------------------------------------------- ------- ------- 1 New Hire - Job not specified 10 102 Chief Executive Officer 200 2503 Business Operations Manager 175 2254 Chief Financial Officier 175 2505 Publisher 150 2506 Managing Editor 140 2257 Marketing Manager 120 2008 Public Relations Manager 100 1759 Acquisitions Manager 75 17510 Productions Manager 75 16511 Operations Manager 75 15012 Editor 25 10013 Sales Representative 25 10014 Designer 25 10015 Accountant 12 12516 Accountant 12 12517 Accountant 12 12518 Accountant 12 125(所影响的行数为 18 行) 谢谢,我还是用的SQL 2000啊 如何在子查询中返回多个字段 如果获取系统整点时间 Identity 征集Sql,精华都贴出来吧 我想做数据库性能测试,但是没有数据,谁有几十万到100多万的数据 关于分组记录的一个问题,求方法。 解释下sql2000的一个存储过程 SQL2000哪个版本支持安装虚拟服务器的? 谁解决了我的问题,我再送他100分一共200分!够吧! 大虾们快来啊 字段长度不同的数据库可以合并吗? BeginTrans()作用
@tb_name varchar(20)
as
exec('
select * from ' + @tb_name +';')gouse pubs
exec sp_test1 'jobs'job_id job_desc min_lvl max_lvl
------ -------------------------------------------------- ------- -------
1 New Hire - Job not specified 10 10
2 Chief Executive Officer 200 250
3 Business Operations Manager 175 225
4 Chief Financial Officier 175 250
5 Publisher 150 250
6 Managing Editor 140 225
7 Marketing Manager 120 200
8 Public Relations Manager 100 175
9 Acquisitions Manager 75 175
10 Productions Manager 75 165
11 Operations Manager 75 150
12 Editor 25 100
13 Sales Representative 25 100
14 Designer 25 100
15 Accountant 12 125
16 Accountant 12 125
17 Accountant 12 125
18 Accountant 12 125(所影响的行数为 18 行)