Click here to Skip to main content
15,907,225 members
Home / Discussions / Database
   

Database

 
AnswerRe: INSERT - Date/Time INTO SQL ?? Pin
WoutL29-May-07 22:21
WoutL29-May-07 22:21 
GeneralRe: INSERT - Date/Time INTO SQL ?? Pin
Fritzables29-May-07 22:42
Fritzables29-May-07 22:42 
GeneralRe: INSERT - Date/Time INTO SQL ?? Pin
WoutL29-May-07 23:56
WoutL29-May-07 23:56 
GeneralRe: INSERT - Date/Time INTO SQL ?? Pin
Fritzables30-May-07 0:50
Fritzables30-May-07 0:50 
QuestionPocket PC without sql server 2005 CE Pin
Kholed29-May-07 21:34
Kholed29-May-07 21:34 
QuestionHow to show records except sunday dates and weekdays separately..., Pin
Member 387988129-May-07 21:25
Member 387988129-May-07 21:25 
AnswerRe: How to show records except sunday dates and weekdays separately..., Pin
Colin Angus Mackay29-May-07 21:42
Colin Angus Mackay29-May-07 21:42 
GeneralRe: How to show records except sunday dates and weekdays separately..., Pin
Mike Dimmick30-May-07 23:38
Mike Dimmick30-May-07 23:38 
True as far as it goes. However, the problem with applying any function to the data in the table is that the query optimiser cannot use an index on that column, if there is one. If this is the only column in the WHERE clause, or the only column in the GROUP BY or ORDER BY clauses, the query optimiser may have to resort to a table scan, i.e. reading all the rows in the table from beginning to end (it will instead show as a Clustered Index Scan in the query plan if there's a clustered index on the table).

If having an index on this information would be helpful, consider adding an extra column which contains the weekday data, and indexing that.

Be aware that the first day of the week is different in different locales and the return value of DATEPART is therefore affected by the connection settings - you should check the value of @@DATEFIRST in any calculations. For that reason I believe the DATEPART function is considered non-deterministic and it may not be possible to add a computed column and index that - it may need to be a real column. You could use a trigger to update it as required.

Stability. What an interesting concept. -- Chris Maunder

Questiondelete two tables Pin
saravanan0529-May-07 20:12
saravanan0529-May-07 20:12 
AnswerRe: delete two tables Pin
Colin Angus Mackay29-May-07 21:40
Colin Angus Mackay29-May-07 21:40 
AnswerRe: delete two tables Pin
Harini N K29-May-07 22:06
Harini N K29-May-07 22:06 
Questionto get latest version of product Pin
chandru7029-May-07 17:22
chandru7029-May-07 17:22 
AnswerRe: to get latest version of product Pin
shally_7929-May-07 19:26
shally_7929-May-07 19:26 
GeneralRe: to get latest version of product Pin
chandru7029-May-07 19:39
chandru7029-May-07 19:39 
GeneralRe: to get latest version of product Pin
shally_7929-May-07 22:13
shally_7929-May-07 22:13 
GeneralRe: to get latest version of product Pin
chandru7030-May-07 1:19
chandru7030-May-07 1:19 
QuestionQuery AVG help Pin
Hulicat29-May-07 13:22
Hulicat29-May-07 13:22 
AnswerRe: Query AVG help Pin
Hulicat30-May-07 15:12
Hulicat30-May-07 15:12 
QuestionSqlDataSourceEnumerator.GetDataSources Pin
Savas Cilve29-May-07 9:01
Savas Cilve29-May-07 9:01 
QuestionT-SQL Pin
Werries29-May-07 7:55
Werries29-May-07 7:55 
AnswerRe: T-SQL Pin
Mike Dimmick29-May-07 11:17
Mike Dimmick29-May-07 11:17 
GeneralRe: T-SQL Pin
Werries29-May-07 19:28
Werries29-May-07 19:28 
GeneralRe: T-SQL Pin
Colin Angus Mackay29-May-07 21:38
Colin Angus Mackay29-May-07 21:38 
QuestionPL/SQL Package Syntax Pin
Alaric_29-May-07 5:09
professionalAlaric_29-May-07 5:09 
AnswerRe: PL/SQL Package Syntax Pin
Al Ortega29-May-07 5:19
Al Ortega29-May-07 5:19 

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.