about the storeprocess

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 ?
 
C

Cor Ligthert

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
 
R

Ron Allen

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

Ron Allen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top