Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» Celebrity.Sex.Tape.UNCUT.&.UNRATED.2012.720p.BRrip.x264.YIFY.mp4
Tue Dec 17, 2013 8:32 am by titquarra

» Maya Autodesk Personal Learning Edition 8.5
Tue Dec 17, 2013 7:47 am by titquarra

» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

Shopmotion


Affiliates
free forum


Store Procedure thêm, xóa, sửa.

View previous topic View next topic Go down

Store Procedure thêm, xóa, sửa.

Post  Admin on Thu Mar 29, 2012 1:02 am

@Action char(1),
@UserName nvarchar(50),
@Pass nvarchar(50),
@error nvarchar(50) output
as
begin tran
if @Action=’t’
begin
if exists (select UserName from Account where UserName=@UserName)
begin
update Account set Pass=@Pass where UserName=@UserName
if @@ERROR<>0
begin
set @error=N’Sửa Thất Bại’
if @@TRANCOUNT <>0
rollback tran
goto Error
end
else
set @error=N’Sửa Thành Công’
end
else
begin
insert into Account(UserName,Pass) values (@UserName,@Pass)
if @@ERROR<>0
begin
set @error=N’Thêm Thất Bại’
if @@TRANCOUNT<>0
rollback tran
goto Error
end
else
set @error=N’Thêm Thành Công’
end
end
if @Action=’x’
begin
if exists (select UserName from Account where UserName=@UserName)
begin
delete Account where UserName=@UserName
if @@ERROR<>0
begin
set @error=N’Xóa Thất Bại’
if @@TRANCOUNT<>0
rollback tran
goto Error
end
else
set @error=N’Xóa Thành Công’
end
else
set @error=N’Tài Khoản Này Không Tồn Tại’
end
select @error
commit tran

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum