表变量可以做为存储过程的输入或输出参数吗?
若可以请给个实例,谢谢!

解决方案 »

  1.   

    create proc sp_test1
    @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 行)
      

  2.   

    谢谢,我还是用的SQL 2000啊