Click here to Skip to main content
15,920,630 members
Home / Discussions / Database
   

Database

 
GeneralRe: Any Access experts here Pin
Michael P Butler19-Mar-03 3:25
Michael P Butler19-Mar-03 3:25 
GeneralDBConcurrencyException: Delete a entry in master -detail table Pin
DionChen18-Mar-03 10:16
DionChen18-Mar-03 10:16 
QuestionAlternatives to Access??? Pin
LukeV18-Mar-03 3:05
LukeV18-Mar-03 3:05 
AnswerRe: Alternatives to Access??? Pin
LukeV18-Mar-03 9:36
LukeV18-Mar-03 9:36 
GeneralRe: Alternatives to Access??? Pin
perlmunger18-Mar-03 11:01
perlmunger18-Mar-03 11:01 
AnswerRe: Alternatives to Access??? Pin
Alexander Kojevnikov18-Mar-03 22:13
Alexander Kojevnikov18-Mar-03 22:13 
QuestionCan ado.net support data warehouse metadata? Pin
mihi17-Mar-03 16:07
mihi17-Mar-03 16:07 
GeneralPerformance issues Pin
Le centriste17-Mar-03 9:37
Le centriste17-Mar-03 9:37 
I went through some of my colleague's (who left for another project) SQL code and I encountered the following where clause (part of it, actually):

where ...
convert(varchar(25), td.CreationDate, 111) >= (getutcdate() - @NumOfDays) and 
convert(varchar(25), td.CreationDate, 111) <= (getutcdate())
...


This is part of a larger where and it narrows the search to rows younger than @NumOfDays days.

The problem I see here is that the convert(varchar(25), td.CreationDate, 111) must be executed on every row in the table (Am I right here?). This query will tend to become slower each day as the table grows (and it is expected to grow a couple thousands of rows per day).

Am I right to say that this query will eventually come to a crawl or an I just smoking some bad stuff?

NOTE: td.CreationDate does not have to be converted to its date part only. The time part can stay.

Would it be right to replace it by:

td.CreationDate >= dateadd(day, -@NumOfDays, getutcdate()) and
td.CreationDate <= getutcdate()


And I even suspect that
td.CreationDate >= dateadd(day, -@NumOfDays, getutcdate())


would be sufficient since the td.CreationDate field cannot be in the future (or I am missing something here).

Tx
GeneralRe: Performance issues Pin
DiWa17-Mar-03 20:29
DiWa17-Mar-03 20:29 
GeneralRe: Performance issues Pin
Le centriste18-Mar-03 2:54
Le centriste18-Mar-03 2:54 
GeneralSQL server and IPC Pin
Faraz Siddiqi17-Mar-03 0:40
Faraz Siddiqi17-Mar-03 0:40 
QuestionHow to retrive data from dataset object? Pin
Segal16-Mar-03 21:22
Segal16-Mar-03 21:22 
AnswerRe: How to retrive data from dataset object? Pin
leppie17-Mar-03 6:29
leppie17-Mar-03 6:29 
Questionconvert sql to oledb? Pin
jackyyeung16-Mar-03 5:52
jackyyeung16-Mar-03 5:52 
GeneralUsing MSDE in stand-alone Windows Forms projects Pin
Aroogala15-Mar-03 18:29
Aroogala15-Mar-03 18:29 
GeneralRe: Using MSDE in stand-alone Windows Forms projects Pin
nullpointer15-Mar-03 20:04
nullpointer15-Mar-03 20:04 
GeneralRe: Using MSDE in stand-alone Windows Forms projects Pin
Rob Graham17-Mar-03 4:23
Rob Graham17-Mar-03 4:23 
GeneralVariable Table Identifiers Pin
Jeff J15-Mar-03 10:41
Jeff J15-Mar-03 10:41 
GeneralRe: Variable Table Identifiers Pin
Rob Graham17-Mar-03 4:35
Rob Graham17-Mar-03 4:35 
GeneralRe: Variable Table Identifiers Pin
Jeff J17-Mar-03 15:44
Jeff J17-Mar-03 15:44 
GeneralRe: Variable Table Identifiers Pin
Rob Graham17-Mar-03 16:14
Rob Graham17-Mar-03 16:14 
Generalmsadodc.ocx Pin
kfoust13-Mar-03 15:39
kfoust13-Mar-03 15:39 
GeneralAddNew Record Pin
Anthony988713-Mar-03 4:00
Anthony988713-Mar-03 4:00 
GeneralOracle Listener Pin
Harut12-Mar-03 19:01
Harut12-Mar-03 19:01 
GeneralRe: Oracle Listener Pin
RichardGrimmer12-May-03 5:03
RichardGrimmer12-May-03 5:03 

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.