Click here to Skip to main content
15,910,083 members
Home / Discussions / Database
   

Database

 
QuestionOleDbCommandBuilder problem with views in SqlExpress [modified] Pin
Ahmad Safwat18-May-08 0:34
Ahmad Safwat18-May-08 0:34 
GeneralRe: OleDbCommandBuilder problem with views in SqlExpress Pin
Ahmad Safwat18-May-08 21:49
Ahmad Safwat18-May-08 21:49 
QuestionHow do i allow duplicates in my primary key? Pin
ap_ple17-May-08 16:56
ap_ple17-May-08 16:56 
AnswerRe: How do i allow duplicates in my primary key? Pin
Alsvha17-May-08 21:29
Alsvha17-May-08 21:29 
AnswerRe: How do i allow duplicates in my primary key? Pin
Blue_Boy17-May-08 22:20
Blue_Boy17-May-08 22:20 
AnswerRe: How do i allow duplicates in my primary key? Pin
Mycroft Holmes18-May-08 16:21
professionalMycroft Holmes18-May-08 16:21 
NewsRe: How do i allow duplicates in my primary key? Pin
Vinay Dornala19-May-08 20:04
Vinay Dornala19-May-08 20:04 
QuestionTrying to choose between two rows Pin
Fernando A. Gomez F.16-May-08 12:08
Fernando A. Gomez F.16-May-08 12:08 
Ok, I have this very bizarre problem. I have a table with these columns: id, created_date, status. For some weird and stupid reason, the DBA decided that both id and created_date are keys. So, say that we want to change the status for id=1. You'd think that an update would be a nice idea. Wrong. It must insert another record, same id, different created_date, and the new status. Ok, if boss wants it that way, so be it.

The thing is that now, I'm requested to create a query (returned from a stored procedure) that will return me this fields, BUT if an id has two records (say, one with 'Active' status and the other one with 'Inactive' status, I should keep only the 'Inactive' record.

As an example, let's say that in the table we have the following data:

ID        Created              Status
================================================
1         2008-05-10           Active
2         2008-05-11           Active
2         2008-05-12           Inactive
3         2008-05-13           Inactive


then, the query should show the first line, the third line (because there are two rows with the same ID, being the second line the discarded because the status is 'Active'), and the fourth line.

Any ideas will be really appreciated, as all I've thought is useless so far.


Stupidity is an International Association - Enrique Jardiel Poncela
Die deutsche Sprache sollte sanft und ehrfurchtsvoll zu den toten Sprachen abgelegt werden, denn nur die Toten haben die Zeit, diese Sprache zu lernen. - Mark Twain

AnswerRe: Trying to choose between two rows Pin
Blue_Boy16-May-08 12:44
Blue_Boy16-May-08 12:44 
Generalw00t! Pin
Fernando A. Gomez F.16-May-08 13:34
Fernando A. Gomez F.16-May-08 13:34 
GeneralRe: w00t! Pin
Blue_Boy16-May-08 13:36
Blue_Boy16-May-08 13:36 
QuestionLIKE Condition Pin
jonhbt15-May-08 22:19
jonhbt15-May-08 22:19 
AnswerRe: LIKE Condition Pin
Blue_Boy15-May-08 22:38
Blue_Boy15-May-08 22:38 
AnswerRe: LIKE Condition Pin
GuyThiebaut16-May-08 2:35
professionalGuyThiebaut16-May-08 2:35 
Questionsql server - connecting asmx web service Pin
tai-fun15-May-08 21:57
tai-fun15-May-08 21:57 
AnswerRe: sql server - connecting asmx web service Pin
Ashfield16-May-08 5:09
Ashfield16-May-08 5:09 
GeneralRe: sql server - connecting asmx web service Pin
tai-fun16-May-08 7:53
tai-fun16-May-08 7:53 
QuestionGet Database Name Pin
Dushan12315-May-08 21:42
Dushan12315-May-08 21:42 
AnswerRe: Get Database Name Pin
Blue_Boy15-May-08 21:49
Blue_Boy15-May-08 21:49 
QuestionMy Sql Date Formatting Issue Pin
Anupbala15-May-08 20:04
Anupbala15-May-08 20:04 
QuestionCan it Joined two tables like this? Pin
jason_mf15-May-08 19:18
jason_mf15-May-08 19:18 
AnswerRe: Can it Joined two tables like this? Pin
Krish - KP15-May-08 19:36
Krish - KP15-May-08 19:36 
GeneralRe: Can it Joined two tables like this? Pin
jason_mf15-May-08 19:39
jason_mf15-May-08 19:39 
QuestionINSERT,UPDATE on Attached SQL Database File not working. Pin
JOSHY M RAJ15-May-08 18:50
JOSHY M RAJ15-May-08 18:50 
AnswerRe: INSERT,UPDATE on Attached SQL Database File not working. Pin
Mycroft Holmes15-May-08 20:07
professionalMycroft Holmes15-May-08 20:07 

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.