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 ?

Re: about the storeprocess by Cor

Cor
Thu Mar 10 04:37:19 CST 2005

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



Re: about the storeprocess by Ron

Ron
Thu Mar 10 08:10:23 CST 2005

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

Ron Allen
"kylin" <w0wd@sohu.com> wrote in message
news:uUsGnzSJFHA.3420@tk2msftngp13.phx.gbl...
> 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 ?
>
>