Click here to Skip to main content
15,947,476 members
Home / Discussions / Database
   

Database

 
GeneralRe: Sql server 2008 R2 Express Edition working very slow why? Pin
Eddy Vluggen25-Mar-15 3:11
professionalEddy Vluggen25-Mar-15 3:11 
GeneralRe: Sql server 2008 R2 Express Edition working very slow why? Pin
Corporal Agarn25-Mar-15 4:00
professionalCorporal Agarn25-Mar-15 4:00 
AnswerRe: Sql server 2008 R2 Express Edition working very slow why? Pin
Tim Carmichael25-Mar-15 2:33
Tim Carmichael25-Mar-15 2:33 
GeneralRe: Sql server 2008 R2 Express Edition working very slow why? Pin
Sandeep Tripathi25-Mar-15 2:43
Sandeep Tripathi25-Mar-15 2:43 
GeneralRe: Sql server 2008 R2 Express Edition working very slow why? Pin
Tim Carmichael25-Mar-15 2:52
Tim Carmichael25-Mar-15 2:52 
AnswerRe: Sql server 2008 R2 Express Edition working very slow why? Pin
David Mujica25-Mar-15 3:35
David Mujica25-Mar-15 3:35 
AnswerRe: Sql server 2008 R2 Express Edition working very slow why? Pin
jschell25-Mar-15 11:50
jschell25-Mar-15 11:50 
AnswerRe: Sql server 2008 R2 Express Edition working very slow why? Pin
Mycroft Holmes25-Mar-15 15:35
professionalMycroft Holmes25-Mar-15 15:35 
Well I have seen some horror stored procs in my time and this one is particularly nasty.

Split the proc in multiples procedures to return 1 dataset each, multiple dataset can destroy the performance.

You have business logic in your stored proc (c.title and followupstatus should be reference/dimension tables)

You are formatting dates in the database, leave that to the client.

This looks like a complete horror - looks like you are storing date & time when you really only need the date and this kludge it trying to deal with it.
SQL
WHERE ((CONVERT(NVARCHAR(10), a.follow_up_date_, 121) + ' ' + CONVERT(CHAR(5), CAST(a.follow_up_time AS DATETIME), 108)) < (CONVERT(VARCHAR(16), GETDATE(), 121)))
    AND (CONVERT(NVARCHAR(MAX), a.follow_up_date_, 101) + ' ' + CONVERT(NVARCHAR(MAX), SUBSTRING(a.follow_up_time, 1, 5), 108)) <= (CONVERT(VARCHAR(16), GETDATE(), 120))

Try using datetime data type, BETWEEN may be useful to you.

This seems to indicate you are storing your dates as varchar -
SQL
ORDER BY CONVERT(DATETIME, follow_up_date) DESC
one of the most basic and expensive errors a database designer can make.

I don't think you can blame the database server if this is what you are asking it to deal with. When you have cleaned up the errors you should then use profiler to determine if indexes can improve the performance.
Never underestimate the power of human stupidity
RAH

Questionhow to create a chart from a database in android eclipse .. please help me :D Pin
Pungkas Soebarkah24-Mar-15 23:24
Pungkas Soebarkah24-Mar-15 23:24 
AnswerRe: how to create a chart from a database in android eclipse .. please help me :D Pin
Mycroft Holmes25-Mar-15 15:16
professionalMycroft Holmes25-Mar-15 15:16 
QuestionNDF File Pin
Member 1133602724-Mar-15 8:45
Member 1133602724-Mar-15 8:45 
QuestionRe: NDF File Pin
ZurdoDev24-Mar-15 8:51
professionalZurdoDev24-Mar-15 8:51 
AnswerRe: NDF File Pin
Richard Deeming24-Mar-15 9:15
mveRichard Deeming24-Mar-15 9:15 
AnswerRe: NDF File Pin
Richard Deeming24-Mar-15 9:18
mveRichard Deeming24-Mar-15 9:18 
QuestionHelp needed on string function Pin
Ambertje24-Mar-15 6:01
Ambertje24-Mar-15 6:01 
AnswerRe: Help needed on string function Pin
Kornfeld Eliyahu Peter24-Mar-15 7:42
professionalKornfeld Eliyahu Peter24-Mar-15 7:42 
GeneralRe: Help needed on string function Pin
Ambertje24-Mar-15 23:43
Ambertje24-Mar-15 23:43 
GeneralRe: Help needed on string function Pin
Johan Hakkesteegt8-Apr-15 2:36
Johan Hakkesteegt8-Apr-15 2:36 
QuestionVB.NET MYSQL DATATABLE Pin
Pauls Pauls21-Mar-15 4:33
Pauls Pauls21-Mar-15 4:33 
AnswerRe: VB.NET MYSQL DATATABLE Pin
Peter Leow21-Mar-15 4:56
professionalPeter Leow21-Mar-15 4:56 
AnswerRe: VB.NET MYSQL DATATABLE Pin
manchanx21-Mar-15 5:14
professionalmanchanx21-Mar-15 5:14 
GeneralRe: VB.NET MYSQL DATATABLE Pin
Pauls Pauls21-Mar-15 6:16
Pauls Pauls21-Mar-15 6:16 
QuestionOracle, inner join and substr function Pin
Ludwing RS20-Mar-15 9:29
Ludwing RS20-Mar-15 9:29 
AnswerRe: Oracle, inner join and substr function Pin
Eddy Vluggen20-Mar-15 10:21
professionalEddy Vluggen20-Mar-15 10:21 
AnswerRe: Oracle, inner join and substr function Pin
Jörgen Andersson20-Mar-15 13:20
professionalJörgen Andersson20-Mar-15 13:20 

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.