Click here to Skip to main content
15,899,634 members
Home / Discussions / Database
   

Database

 
GeneralRe: Create Index with 2 columns (Ignoring when col 1 =0) Pin
AlexeiXX39-Apr-08 8:53
AlexeiXX39-Apr-08 8:53 
GeneralRe: Create Index with 2 columns (Ignoring when col 1 =0) Pin
SimulationofSai9-Apr-08 9:10
SimulationofSai9-Apr-08 9:10 
QuestionMSSQL Distinct for one field, possible? Pin
hifiger20048-Apr-08 7:27
hifiger20048-Apr-08 7:27 
AnswerRe: MSSQL Distinct for one field, possible? Pin
Blue_Boy8-Apr-08 11:09
Blue_Boy8-Apr-08 11:09 
AnswerRe: MSSQL Distinct for one field, possible? Pin
hifiger200410-Apr-08 6:30
hifiger200410-Apr-08 6:30 
GeneralRe: MSSQL Distinct for one field, possible? Pin
Blue_Boy10-Apr-08 10:06
Blue_Boy10-Apr-08 10:06 
GeneralAuthenticate User in SQL Stored Procedure Pin
Paul McGann8-Apr-08 4:16
professionalPaul McGann8-Apr-08 4:16 
GeneralRe: Authenticate User in SQL Stored Procedure Pin
Mark J. Miller8-Apr-08 5:31
Mark J. Miller8-Apr-08 5:31 
EXISTS works like this:

<br />
IF EXISTS(SELECT * FROM Users WHERE User_Username = @Username AND User_Password = @Password) BEGIN<br />
  SELECT * FROM Users WHERE User_Username = @Username AND User_Password = @Password<br />
END<br />


But there is no reason to use it in this case. Most often it is used like this to determine if an UPDATE (record exists) or an INSERT (does not exist) should be done.

If you just change your procedure to this:

<br />
CREATE PROCEDURE dbo.Authenticate_User<br />
@Username varchar(50),<br />
@Password varchar(50)<br />
AS<br />
<br />
SELECT * FROM Users WHERE User_Username = @Username AND User_Password = @Password<br />
<br />


Then you will exactly the same result as with the EXISTS, but you won't be wasting resources querying for the record twice.


QuestionFront End GUI mySQL DB Manager Suggestions? Pin
humblepgmr8-Apr-08 3:57
humblepgmr8-Apr-08 3:57 
AnswerRe: Front End GUI mySQL DB Manager Suggestions? Pin
John_Adams8-Apr-08 21:55
John_Adams8-Apr-08 21:55 
AnswerRe: Front End GUI mySQL DB Manager Suggestions? Pin
ChandraRam9-Apr-08 2:03
ChandraRam9-Apr-08 2:03 
QuestionSybase: how can I select from stored proc? Pin
devvvy8-Apr-08 3:17
devvvy8-Apr-08 3:17 
AnswerRe: Sybase: how can I select from stored proc? Pin
Mark J. Miller8-Apr-08 5:48
Mark J. Miller8-Apr-08 5:48 
GeneralRe: Sybase: how can I select from stored proc? Pin
devvvy8-Apr-08 14:56
devvvy8-Apr-08 14:56 
GeneralReplication Pin
briogene8-Apr-08 0:53
briogene8-Apr-08 0:53 
GeneralSQL - Insert Record Error Trapping Pin
imnotso#7-Apr-08 23:09
imnotso#7-Apr-08 23:09 
GeneralRe: SQL - Insert Record Error Trapping Pin
Blue_Boy8-Apr-08 0:39
Blue_Boy8-Apr-08 0:39 
GeneralRe: SQL - Insert Record Error Trapping Pin
imnotso#8-Apr-08 0:42
imnotso#8-Apr-08 0:42 
GeneralRe: SQL - Insert Record Error Trapping Pin
Michael Potter8-Apr-08 4:04
Michael Potter8-Apr-08 4:04 
GeneralRe: SQL - Insert Record Error Trapping Pin
imnotso#8-Apr-08 4:15
imnotso#8-Apr-08 4:15 
GeneralRe: SQL - Insert Record Error Trapping Pin
Michael Potter8-Apr-08 4:47
Michael Potter8-Apr-08 4:47 
QuestionIs there a query that can change all datasources for all dataviews? Pin
Daniel_Logan7-Apr-08 23:01
Daniel_Logan7-Apr-08 23:01 
AnswerRe: Is there a query that can change all datasources for all dataviews? Pin
Paddy Boyd8-Apr-08 0:48
Paddy Boyd8-Apr-08 0:48 
GeneralRe: Is there a query that can change all datasources for all dataviews? Pin
Daniel_Logan8-Apr-08 2:40
Daniel_Logan8-Apr-08 2:40 
GeneralRe: Is there a query that can change all datasources for all dataviews? Pin
Pete O'Hanlon8-Apr-08 2:58
mvePete O'Hanlon8-Apr-08 2:58 

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.