Click here to Skip to main content
16,006,594 members
Home / Discussions / Database
   

Database

 
AnswerRe: Sql update problem Pin
mghiassi24-Mar-07 5:34
mghiassi24-Mar-07 5:34 
QuestionGenerate SQL Script for tables Pin
dhananjayamurthy19-Mar-07 10:01
dhananjayamurthy19-Mar-07 10:01 
AnswerRe: Generate SQL Script for tables Pin
Colin Angus Mackay19-Mar-07 13:19
Colin Angus Mackay19-Mar-07 13:19 
AnswerRe: Generate SQL Script for tables Pin
Laxman Auti20-Mar-07 5:03
Laxman Auti20-Mar-07 5:03 
Questiondataset.acceptchange method [modified] Pin
manni_n19-Mar-07 7:58
manni_n19-Mar-07 7:58 
QuestionHow to script job in stored proc to run on dynamicly assigned server? Pin
RainFox19-Mar-07 1:06
RainFox19-Mar-07 1:06 
QuestionQuick Index question Pin
Rob Philpott18-Mar-07 23:09
Rob Philpott18-Mar-07 23:09 
AnswerRe: Quick Index question Pin
andyharman19-Mar-07 2:02
professionalandyharman19-Mar-07 2:02 
Hi Rob

If your first index is on AssetId, Date, DataSource and UserId (in that order) then you don't really need a separate index on AssetId and Date because they are the leading columns in you primary key.

The conventional wisdom is that you should put your most unique columns at the front of indexes. I tend to recommend that you put the columns that are most commonly searched upon (which may be different).

If you also needed to frequently search on UserId and Date then you would consider using an additional index.

Note that (by default) SQL-Server uses a clustered index to enforce primary keys. This has the side-effect of appending your primary key columns to every non-clustered index that you create on the table. If you are using this primary key to join tables then you might want to consider using a separate identity column as the primary key on this table, and a separate non-clustered index on the four columns that you noted in your question.

Regards
Andy
GeneralRe: Quick Index question Pin
Rob Philpott19-Mar-07 4:25
Rob Philpott19-Mar-07 4:25 
GeneralRe: Quick Index question Pin
Mike Dimmick19-Mar-07 5:10
Mike Dimmick19-Mar-07 5:10 
Questionhow to perform pagging using stored processors Pin
Imran Khan Pathan18-Mar-07 22:18
Imran Khan Pathan18-Mar-07 22:18 
AnswerRe: how to perform pagging using stored processors Pin
Harini N K18-Mar-07 22:52
Harini N K18-Mar-07 22:52 
AnswerRe: how to perform pagging using stored processors Pin
Pete O'Hanlon18-Mar-07 23:52
mvePete O'Hanlon18-Mar-07 23:52 
Questioncolumn length select query Pin
playout18-Mar-07 20:31
playout18-Mar-07 20:31 
AnswerRe: column length select query Pin
Ziyad Mohammad18-Mar-07 20:47
Ziyad Mohammad18-Mar-07 20:47 
GeneralRe: column length select query Pin
playout18-Mar-07 21:53
playout18-Mar-07 21:53 
Questioninstalled in server and run from client Pin
hamid_m17-Mar-07 23:21
hamid_m17-Mar-07 23:21 
AnswerRe: installed in server and run from client Pin
Colin Angus Mackay18-Mar-07 3:38
Colin Angus Mackay18-Mar-07 3:38 
Questionupdating table of one database with data from another database? Pin
PandemoniumPasha17-Mar-07 19:55
PandemoniumPasha17-Mar-07 19:55 
AnswerRe: updating table of one database with data from another database? Pin
mghiassi18-Mar-07 9:56
mghiassi18-Mar-07 9:56 
AnswerRe: updating table of one database with data from another database? Pin
Ziyad Mohammad18-Mar-07 20:50
Ziyad Mohammad18-Mar-07 20:50 
AnswerRe: updating table of one database with data from another database? Pin
Pete O'Hanlon18-Mar-07 23:58
mvePete O'Hanlon18-Mar-07 23:58 
Questionhow to use trigger in sql server 2005 ? Pin
hdv21217-Mar-07 7:26
hdv21217-Mar-07 7:26 
AnswerRe: how to use trigger in sql server 2005 ? Pin
Pete O'Hanlon18-Mar-07 23:54
mvePete O'Hanlon18-Mar-07 23:54 
QuestionHow can I Inserting to a table Pin
mghiassi17-Mar-07 6:41
mghiassi17-Mar-07 6:41 

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.