码迷,mamicode.com
首页 > 数据库 > 详细

SQL Server存储过程创建和修改

时间:2016-12-29 11:11:13      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:create   end   into   val   varchar   delete   nbsp   from   rom   

create proc Get_Data
(
@Del_ID varchar(36)
)
as
select * from Depts where DeptId=@Del_ID

select * from Depts

 

create procedure proc_Insert_Data

@DealerID varchar(36)

as
begin
declare @count int
select @count=(select COUNT(*) from Depts where DeptName=@DealerID)
if(@count>0)
begin
delete from Depts where DeptId=@DealerID
insert into Depts(DeptName) values(@DealerID)
end
else
begin
insert into Depts(DeptName) values(@DealerID)
end
end

SQL Server存储过程创建和修改

标签:create   end   into   val   varchar   delete   nbsp   from   rom   

原文地址:http://www.cnblogs.com/yangpeng-jingjing/p/6231896.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!