SQL2005 使用存储过程,往表里插入数据怎么写?

2024-11-28 00:09:32
推荐回答(1个)
回答1:

create procedure insert_activeinfo
as
begin
insert into insert_activeinfo(activeid,activename,activedate,usertypeid) values(..)
end
go

--这样就可以啊,当然你还可以把要插入的值通过参数传进来,譬如:
create procedure insert_activeinfo(@activeid int,@activename varchar(10),@activedate datetime,@usertypeid int)
as
begin
insert into activeinfo(activeid,activename,activedate,usertypeid) values(@activeid,@activename,@activedate,@usertypeid)
end
go