Click here to Skip to main content
15,922,533 members
Home / Discussions / Database
   

Database

 
GeneralRe: connect to access db over internet Pin
Hesham Amin28-Feb-03 23:55
Hesham Amin28-Feb-03 23:55 
GeneralProcess Info Question Pin
Bugoy27-Feb-03 8:49
Bugoy27-Feb-03 8:49 
GeneralRe: Process Info Question Pin
andyharman27-Feb-03 9:37
professionalandyharman27-Feb-03 9:37 
GeneralRe: Process Info Question Pin
Bugoy27-Feb-03 12:27
Bugoy27-Feb-03 12:27 
Question2 sql statement using 2 command and 2 datareader? Pin
ylaine27-Feb-03 2:51
ylaine27-Feb-03 2:51 
AnswerRe: 2 sql statement using 2 command and 2 datareader? Pin
andyharman27-Feb-03 9:23
professionalandyharman27-Feb-03 9:23 
Generalsingle stored procedure Pin
ylaine28-Feb-03 5:44
ylaine28-Feb-03 5:44 
GeneralRe: single stored procedure Pin
andyharman28-Feb-03 7:22
professionalandyharman28-Feb-03 7:22 
Laine

I would suggest something like the following (which I have not tested):

CREATE PROCEDURE Login (
  @username varchar(50),
  @password varchar(50),
  @customerid int OUTPUT)
AS
BEGIN
  --Grab the unique customer ID.
  SELECT @customerid = customerid FROM tblcustomer
    WHERE username = @username AND password = @password

  --If the customer ID is valid then record login time.
  IF @@customerid  > 0
  BEGIN
    INSERT INTO tblLogin (customerid, logindate)
        VALUES(@customerid, CURRENT_TIMESTAMP)
    RETURN 1
  END

  --If we got here then invalid ID/password passed-in.
  RETURN -1
END

You don't need to pass the login-date into the SP because SQL-Server knows what the current date is.

Andy
GeneralRe: single stored procedure Pin
ylaine28-Feb-03 22:05
ylaine28-Feb-03 22:05 
GeneralRe: single stored procedure Pin
andyharman1-Mar-03 23:19
professionalandyharman1-Mar-03 23:19 
GeneralRe: single stored procedure Pin
ylaine2-Mar-03 3:56
ylaine2-Mar-03 3:56 
GeneralDatabase ACCESS 97 to linked server SQL 2000 Pin
youssef26-Feb-03 23:23
youssef26-Feb-03 23:23 
GeneralRe: Database ACCESS 97 to linked server SQL 2000 Pin
David Salter27-Feb-03 23:20
David Salter27-Feb-03 23:20 
QuestionTextbox Control databinding, a bug? Pin
DionChen26-Feb-03 5:27
DionChen26-Feb-03 5:27 
GeneralDB access problem!! Pin
Andrea Ferraro26-Feb-03 3:13
Andrea Ferraro26-Feb-03 3:13 
GeneralRe: DB access problem!! Pin
DiWa26-Feb-03 6:21
DiWa26-Feb-03 6:21 
GeneralRe: DB access problem!! Pin
Andrea Ferraro28-Feb-03 3:06
Andrea Ferraro28-Feb-03 3:06 
GeneralADO help needed Pin
odeveloper26-Feb-03 1:09
odeveloper26-Feb-03 1:09 
GeneralRe: ADO help needed Pin
Jon Hulatt26-Feb-03 4:22
Jon Hulatt26-Feb-03 4:22 
Generalsingle access on store procedure Pin
Delz25-Feb-03 21:00
Delz25-Feb-03 21:00 
GeneralRe: single access on store procedure Pin
SimonS25-Feb-03 21:22
SimonS25-Feb-03 21:22 
GeneralRe: single access on store procedure Pin
Antares68626-Feb-03 0:15
Antares68626-Feb-03 0:15 
GeneralAccessing Visual Fox Pro 3.0 Data Pin
sybux200025-Feb-03 11:00
sybux200025-Feb-03 11:00 
GeneralRe: Accessing Visual Fox Pro 3.0 Data Pin
andyharman26-Feb-03 0:43
professionalandyharman26-Feb-03 0:43 
GeneralRe: Accessing Visual Fox Pro 3.0 Data Pin
sybux200026-Feb-03 5:06
sybux200026-Feb-03 5:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.