Click here to Skip to main content
15,888,984 members
Home / Discussions / Database
   

Database

 
GeneralRe: Would an index make this query faster? Pin
khun_panya29-Jan-14 6:23
khun_panya29-Jan-14 6:23 
AnswerRe: Would an index make this query faster? Pin
GuyThiebaut28-Jan-14 3:32
professionalGuyThiebaut28-Jan-14 3:32 
GeneralRe: Would an index make this query faster? Pin
Jörgen Andersson28-Jan-14 9:11
professionalJörgen Andersson28-Jan-14 9:11 
QuestionAnalyser index recommendations Pin
vkEE27-Jan-14 8:32
vkEE27-Jan-14 8:32 
AnswerRe: Analyser index recommendations Pin
Mycroft Holmes27-Jan-14 12:04
professionalMycroft Holmes27-Jan-14 12:04 
AnswerRe: Analyser index recommendations Pin
Shameel27-Jan-14 22:31
professionalShameel27-Jan-14 22:31 
QuestionConditional SQL commands: Good? Bad? Pin
Gregory Gadow27-Jan-14 5:10
Gregory Gadow27-Jan-14 5:10 
AnswerRe: Conditional SQL commands: Good? Bad? Pin
Richard Deeming27-Jan-14 5:21
mveRichard Deeming27-Jan-14 5:21 
I'd agree that it's better to put this in SQL than the application. In SQL, there's less chance of the row being deleted between the If Exists test and the Update statement.

However, I've seen suggestions that something like this might be slightly more efficient:
SQL
UPDATE YourTable SET ... WHERE ID = @ID

If @@ROWCOUNT = 0
   INSERT YourTable (...) VALUES (...);




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Conditional SQL commands: Good? Bad? Pin
Eddy Vluggen28-Jan-14 3:21
professionalEddy Vluggen28-Jan-14 3:21 
AnswerRe: Conditional SQL commands: Good? Bad? Pin
Jörgen Andersson27-Jan-14 5:29
professionalJörgen Andersson27-Jan-14 5:29 
AnswerRe: Conditional SQL commands: Good? Bad? Pin
Kornfeld Eliyahu Peter27-Jan-14 8:07
professionalKornfeld Eliyahu Peter27-Jan-14 8:07 
AnswerRe: Conditional SQL commands: Good? Bad? Pin
Gregory Gadow27-Jan-14 10:03
Gregory Gadow27-Jan-14 10:03 
AnswerRe: Conditional SQL commands: Good? Bad? Pin
Mycroft Holmes27-Jan-14 12:00
professionalMycroft Holmes27-Jan-14 12:00 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Kornfeld Eliyahu Peter27-Jan-14 20:45
professionalKornfeld Eliyahu Peter27-Jan-14 20:45 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Mycroft Holmes27-Jan-14 20:57
professionalMycroft Holmes27-Jan-14 20:57 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Kornfeld Eliyahu Peter27-Jan-14 21:02
professionalKornfeld Eliyahu Peter27-Jan-14 21:02 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Mycroft Holmes27-Jan-14 21:06
professionalMycroft Holmes27-Jan-14 21:06 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Kornfeld Eliyahu Peter28-Jan-14 23:28
professionalKornfeld Eliyahu Peter28-Jan-14 23:28 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Jörgen Andersson27-Jan-14 23:10
professionalJörgen Andersson27-Jan-14 23:10 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Richard Deeming28-Jan-14 1:34
mveRichard Deeming28-Jan-14 1:34 
GeneralRe: Conditional SQL commands: Good? Bad? Pin
Jörgen Andersson28-Jan-14 2:32
professionalJörgen Andersson28-Jan-14 2:32 
AnswerRe: Conditional SQL commands: Good? Bad? Pin
Shameel27-Jan-14 22:39
professionalShameel27-Jan-14 22:39 
AnswerRe: Conditional SQL commands: Good? Bad? Pin
jschell28-Jan-14 10:40
jschell28-Jan-14 10:40 
QuestionDatabase Design Tools? Pin
Code_Crash26-Jan-14 21:41
Code_Crash26-Jan-14 21:41 
AnswerRe: Database Design Tools? Pin
Richard MacCutchan26-Jan-14 21:58
mveRichard MacCutchan26-Jan-14 21: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.