带参数的存储过程怎么写

谁能写个带参数的存储过程示例代码

共有1个回答
  • silvesun - 1年前

    CREATE PROCEDURE dbo.AXzhz
    /*
    这里写注释
    */
    @startDate varchar(16),
    @endDate varchar(16)
    AS
     select id  from table_AX where commentDateTime>@startDate and commentDateTime<@endDate order by contentownerid DESC
    
    
    注:@startDate varchar(16)是声明@startDate 这个变量,多个变量名间用【,】隔开.后面的SQL就可以使用这个变量了.