about the storeprocess

  • Thread starter Thread starter kylin
  • Start date Start date
K

kylin

ALTER PROCEDURE Login
@LName nvarchar(50),
@Pwd nvarchar(500)
AS
declare @myID int

SET NOCOUNT ON

if exists
(
select @myID = ID from kylin_user where lname=@lname and pwd=@pwd
)
begin
insert into kylin_log(UID,TLogin)values(@myID,Getdate())
end

RETURN

but it mind that @myID=ID wrong !
what't the errors ?
 
Kylin,
select @myID = ID from kylin_user where lname=@lname and pwd=@pwd

ID = @myID

ID is the fieldname in your database
@myID is the parameter you are suplying to the SQL string.

I hope this helps,

Cor
 
kylin,
Use
SET @myID = (SELECT ID from kylin_user where lname = @lname and pwd = @pwd);

Ron Allen
 
Back
Top