?? accountdata.sql
字號:
create table AccountData
(
CAccountID char(16) not null,
CPassword char(16),
iAccountID int IDENTITY(0,1),
cLogIP char(16),
iAdminLevel tinyint default(0),
LoginDate smalldatetime default (getdate()),
LogoutDate smalldatetime default (getdate()),
BlockData smalldatetime default (getdate()),
Account_Data smalldatetime default (getdate() - 1),
iAccount_Time int default(0)
)
--drop table AccountData
alter table dbo.AccountData add constraint AccountData_CL
primary key clustered(CAccountID)
--drop proc dbo.s_AccSt
create proc dbo.s_AccSt
@AID AS char(16)
AS
SET NOCOUNT ON
select CPassword,iAccountID,iAdminLevel,BlockData
from dbo.AccountData where CAccountID = @AID
go
exec s_AccSt 'hoon1'
/*Update 且 惑炔撈 割俺牢啊*/
/*
create proc sp_AccUp
@AID as char(16),
@Pass as char(16),
@IAID as int,
@LIP as char(16),
@AL as tinyint,
@LDt as smalldatetime,
@LTDt as smalldatetime,
@BLDt as smalldatetime,
@ADt as smalldatetime,
@ATM int
As
begin tran
update AccountData set
CPassword = @Pass,
iAccountID = @IAID,
cLogIP = @LIP,
iAdminLevel = @AL,
LoginDate = @LDt,
LogoutDate = @LTDt,
BlockData = @BLDt,
Account_Data = @ADt,
iAccount_Time = @ATM
where CAccountID = @AID
if @@Error <> 0
begin
rollback tran
end
else
begin
commit tran
end
go
drop proc s_AccUp*/
--@LDt as smalldatetime,
--drop proc dbo.s_AccLIUp
/*@LDt*/
create proc dbo.s_AccLIUp
@AID AS char(16),
@LIP as char(16)
As
SET NOCOUNT ON
begin tran
update AccountData set cLogIP = @LIP, LoginDate = getdate() where CAccountID = @AID
if @@Error <> 0
begin
rollback tran
end
else
begin
commit tran
end
go
select * from AccountData
exec s_AccLIUp 'hoon1','1.1.1.1'
exec sp_lock
exec s_AccLIUp '1234567890123456','2004-05-05','1.2.44.44'
select * from AccountData
--drop proc dbo.s_AccLOUp
create proc dbo.s_AccLOUp
@AID as char(16)
--@LTDt as smalldatetime
As
SET NOCOUNT ON
begin tran
update AccountData set
LogoutDate = getdate()--@LTDt
where CAccountID = @AID
if @@Error <> 0
begin
rollback tran
end
else
begin
commit tran
end
go
/*
牢汲飄綽 權其撈瘤俊輯 茄促.
create proc sp_AccIn
@AID as char(16),
@Pass as char(16),
@IAID as int,
@LIP as char(16),
@AL as tinyint,
@LDt as smalldatetime,
@LTDt as smalldatetime,
@BLDt as smalldatetime,
@ADt as smalldatetime,
@ATM int
As
begin tran
insert AccountData values (@AID, @Pass, @IAID, @LIP, @AL, @LDt, @LTDt, @BLDt, @ADt, @ATM)
if @@Error <> 0
begin
rollback tran
end
else
begin
commit tran
end
go
drop proc sp_AccIn
*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -