我想在存储过程中 完成几个SQL语句的操作 可以吗 有没有相关的例子

解决方案 »

  1.   

    ....
    存儲過程中,不就是sql語句操作嗎
      

  2.   

    create procedure procname
    (
       参数1 varchar(20),
       参数2 int,
       ....
    )
    as
    set nocount on
    insert into 表A values (参数1,参数2,.....)
    update 表A set col1=... where 
    selec * from 表A
      

  3.   

    create procedure procname
    (
       参数1 varchar(20),
       参数2 int,
       ....
    )
    as
    set nocount on
    insert into 表A values (参数1,参数2,.....)
    update 表A set col1=... where 
    selec * from 表A
      

  4.   

    create proc test as 
    insert tb select ....
    update tb set col='1' from ta where tadelete tb where colname ='adf'
      

  5.   

    create proc pr
    as 
    begin
    select ...
    update ...
    delete ...
    end
      

  6.   

    create proc ccc
    as
    begin
     select 1
    end