Click here to Skip to main content
15,898,538 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to send data from DB to all running application X's... Pin
jschell16-Mar-11 8:21
jschell16-Mar-11 8:21 
AnswerRe: How to send data from DB to all running application X's... Pin
Klaus-Werner Konrad16-Mar-11 8:00
Klaus-Werner Konrad16-Mar-11 8:00 
QuestionMySql connector and VS2010 SP1 Pin
Daniele Fusi14-Mar-11 4:59
Daniele Fusi14-Mar-11 4:59 
QuestionHow to create user 'sa' on Sql Server Pin
AmbiguousName12-Mar-11 4:25
AmbiguousName12-Mar-11 4:25 
AnswerRe: How to create user 'sa' on Sql Server [modified] Pin
Wendelius12-Mar-11 6:14
mentorWendelius12-Mar-11 6:14 
AnswerRe: How to create user 'sa' on Sql Server Pin
jschell13-Mar-11 10:19
jschell13-Mar-11 10:19 
QuestionConverting to a Relational Database [modified] Pin
Dominick Marciano11-Mar-11 17:26
professionalDominick Marciano11-Mar-11 17:26 
AnswerRe: Converting to a Relational Database Pin
Wendelius12-Mar-11 6:38
mentorWendelius12-Mar-11 6:38 
Hi,

One possibility is to use 'temporary' tables and DISTINCT queries. For example if you have a table with column SiteName and you have duplicate site names, you could do something like:
SELECT DISTINCT SiteName INTO NewSites FROM Sites;
TRNCATE TABLE Sites;
INSERT INTO Sites SELECT * FROM NewSites;
DROP TABLE NewSites;

In the real situation you most likely have more coĺumns and possibly other conditions. This is why I chose this 'temporary' table approach since you can easily check if the result is fine before you delete the original data and possibly do the duplicate elimination in smaller parts if that's more suitable.

This can also be done in-place if you have some kind of mechanism to identify the row. If a table has an Id that's preferred and if it doesn't you could perhaps modify this http://www.codeproject.com/Tips/159984/How-to-remove-duplicate-rows-in-SQL-Server-2005-wh.aspx[^] to your needs.
The need to optimize rises from a bad design.My articles[^]

AnswerRe: Converting to a Relational Database Pin
jschell13-Mar-11 10:25
jschell13-Mar-11 10:25 
AnswerRe: Converting to a Relational Database Pin
Corporal Agarn14-Mar-11 4:26
professionalCorporal Agarn14-Mar-11 4:26 
QuestionTwo physcial servers with same Database name server Pin
vanikanc11-Mar-11 11:00
vanikanc11-Mar-11 11:00 
AnswerRe: Two physcial servers with same Database name server Pin
Wendelius11-Mar-11 11:47
mentorWendelius11-Mar-11 11:47 
QuestionParent-children Listing Pin
Ali Al Omairi(Abu AlHassan)11-Mar-11 8:16
professionalAli Al Omairi(Abu AlHassan)11-Mar-11 8:16 
AnswerRe: Parent-children Listing Pin
Chris Meech11-Mar-11 8:25
Chris Meech11-Mar-11 8:25 
GeneralRe: Parent-children Listing Pin
Ali Al Omairi(Abu AlHassan)11-Mar-11 8:45
professionalAli Al Omairi(Abu AlHassan)11-Mar-11 8:45 
GeneralRe: Parent-children Listing Pin
Chris Meech11-Mar-11 9:04
Chris Meech11-Mar-11 9:04 
GeneralRe: Parent-children Listing Pin
Ali Al Omairi(Abu AlHassan)11-Mar-11 9:09
professionalAli Al Omairi(Abu AlHassan)11-Mar-11 9:09 
GeneralRe: Parent-children Listing Pin
Chris Meech11-Mar-11 9:41
Chris Meech11-Mar-11 9:41 
AnswerRe: Parent-children Listing Pin
Wendelius11-Mar-11 9:16
mentorWendelius11-Mar-11 9:16 
GeneralRe: Parent-children Listing Pin
Ali Al Omairi(Abu AlHassan)11-Mar-11 9:26
professionalAli Al Omairi(Abu AlHassan)11-Mar-11 9:26 
GeneralRe: Parent-children Listing Pin
Wendelius11-Mar-11 12:02
mentorWendelius11-Mar-11 12:02 
AnswerRe: Parent-children Listing Pin
i.j.russell11-Mar-11 23:36
i.j.russell11-Mar-11 23:36 
GeneralRe: Parent-children Listing Pin
Ali AlOmairi (TJIC)12-Mar-11 6:46
Ali AlOmairi (TJIC)12-Mar-11 6:46 
QuestionHow to make this Pin
Nath10-Mar-11 23:59
Nath10-Mar-11 23:59 
AnswerRe: How to make this Pin
musefan11-Mar-11 0:16
musefan11-Mar-11 0:16 

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.