Re: A little help on a proc
From: David Lozzi (dlozzi_at_(remove-this)delphi-ts.com)
Date: 02/07/05
- Next message: Sh0t2bts: "Name Matching"
- Previous message: Keith Kratochvil: "Re: A little help on a proc"
- In reply to: Keith Kratochvil: "Re: A little help on a proc"
- Next in thread: Keith Kratochvil: "Re: A little help on a proc"
- Reply: Keith Kratochvil: "Re: A little help on a proc"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 7 Feb 2005 09:30:50 -0500
So the best process is to rerun the query? Wouldnt that get extensive for
the server? Can I run something like this:
create proc users
@Fullname VARCHAR Output, @Security Integer OUTPUT, etc.
Run query that verifies username
if username valid
check password against previously returned recordset
if password valid
@fullname = returned data, @security, etc.
else
return 2
else
return 1
end
By the way, i'm accessing this from an ASP.NET page.
-- David Lozzi Web Applications/Network Specialist Delphi Technology Solutions, Inc. dlozzi(remove-this)@delphi-ts.com "Keith Kratochvil" <sqlguy.back2u@comcast.net> wrote in message news:eMvhnASDFHA.2632@TK2MSFTNGP12.phx.gbl... > This should get you started: > > create proc foo as > @loginname varchar(20), > @password varchar(50) > as > > --verify that the login is valid > if not exists (select * from sometable where somelogincolumn = @loginname) > BEGIN > RETURN (1) > END > > --verify that the password is valid > if not exists (select * from sometable where somelogincolumn = @loginname > AND somepasswordcolumn = @password) > BEGIN > RETURN (2) > END > > select somecolumn > from sometable > where somelogincolumn = @loginnamae > and somepasswordcolumn = @password > RETURN (0) > GO > > The return code will be 1 if the login does not exist, 2 if the password > is > not correct. If the login exists and the password is correct the third > statement will be executed and the return code will be set to 0. > > -- > Keith > > > "David Lozzi" <dlozzi@(remove-this)delphi-ts.com> wrote in message > news:eShjWtRDFHA.512@TK2MSFTNGP15.phx.gbl... > I'm fairly new to the stored procedure world, I can create one to return a > record set, look at me go. However, I need to get a little more advanced. > I > need to do the following in a proc: > > Query a honken huge query and check if login is valid. If so, continue > through proc and return the necessary data, if not return an invalid > status. > > Thanks a million!! > > > -- > David Lozzi > Web Applications/Network Specialist > Delphi Technology Solutions, Inc. > dlozzi(remove-this)@delphi-ts.com > >
- Next message: Sh0t2bts: "Name Matching"
- Previous message: Keith Kratochvil: "Re: A little help on a proc"
- In reply to: Keith Kratochvil: "Re: A little help on a proc"
- Next in thread: Keith Kratochvil: "Re: A little help on a proc"
- Reply: Keith Kratochvil: "Re: A little help on a proc"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|