Click here to Skip to main content
15,889,462 members
Home / Discussions / Database
   

Database

 
GeneralRe: sql inserting Pin
Krish - KP19-Feb-08 20:12
Krish - KP19-Feb-08 20:12 
GeneralCopy data In table [modified] Pin
kibromg19-Feb-08 6:08
kibromg19-Feb-08 6:08 
GeneralRe: Copy data In table Pin
Mark J. Miller19-Feb-08 7:50
Mark J. Miller19-Feb-08 7:50 
GeneralRe: Copy data In table Pin
kibromg19-Feb-08 9:19
kibromg19-Feb-08 9:19 
GeneralRe: Copy data In table Pin
Mark J. Miller19-Feb-08 11:16
Mark J. Miller19-Feb-08 11:16 
GeneralRe: Copy data In table Pin
kibromg19-Feb-08 23:21
kibromg19-Feb-08 23:21 
GeneralRe: Copy data In table Pin
kibromg19-Feb-08 23:48
kibromg19-Feb-08 23:48 
GeneralRe: Copy data In table Pin
Mark J. Miller20-Feb-08 6:54
Mark J. Miller20-Feb-08 6:54 
INNER JOIN does not require an explicit relationship, so no you have an implicit relationship due to the fact that backuptable will have the same primary key as livetable. You will be able to join the table using the primary key from each table. But if you are only doing inserts then there are two solutions:

1)
INSERT INTO backuptable (columns)<br />
SELECT columns FROM livetable L WHERE NOT EXISTS(SELECT * FROM backuptable WHERE ID = L.ID)<br />


2) If you are using an IDENTITY (aka AutoIncrement) column as your primary key you could also do this
INSERT INTO backuptable (columns)<br />
SELECT columns FROM livetable WHERE ID > (SELECT MAX(ID) FROM backuptable)


The second will be faster as long as there is an index on ID for both tables (which if you have created them correctly and assigned them as primary keys then there will be).


GeneralAPPLICATION TO RUN EVERY FEW SECONDS Pin
kibromg21-Feb-08 5:27
kibromg21-Feb-08 5:27 
QuestionAdvice sought, how do I best handle saving an array in a SQL database? Pin
Per Sderberg19-Feb-08 5:06
Per Sderberg19-Feb-08 5:06 
GeneralRe: Advice sought, how do I best handle saving an array in a SQL database? Pin
Mark J. Miller19-Feb-08 8:26
Mark J. Miller19-Feb-08 8:26 
GeneralRe: Advice sought, how do I best handle saving an array in a SQL database? Pin
Per Sderberg19-Feb-08 21:41
Per Sderberg19-Feb-08 21:41 
QuestionHow do I merge data into one record Pin
KreativeKai19-Feb-08 4:16
professionalKreativeKai19-Feb-08 4:16 
GeneralRe: How do I merge data into one record Pin
Mark J. Miller19-Feb-08 8:12
Mark J. Miller19-Feb-08 8:12 
Questionimages in ms-access database. Pin
avvaru.murali19-Feb-08 2:43
avvaru.murali19-Feb-08 2:43 
GeneralRe: images in ms-access database. Pin
Kschuler19-Feb-08 10:49
Kschuler19-Feb-08 10:49 
Questionembedded database Pin
avvaru.murali19-Feb-08 2:36
avvaru.murali19-Feb-08 2:36 
GeneralRe: embedded database Pin
Colin Angus Mackay19-Feb-08 4:24
Colin Angus Mackay19-Feb-08 4:24 
GeneralProblem with update statement. Pin
matjame19-Feb-08 1:59
matjame19-Feb-08 1:59 
GeneralRe: Problem with update statement. Pin
Mark J. Miller19-Feb-08 8:32
Mark J. Miller19-Feb-08 8:32 
QuestionHow to retrive the transactions back using log files Pin
Satish - Developer18-Feb-08 23:07
Satish - Developer18-Feb-08 23:07 
AnswerRe: How to retrive the transactions back using log files Pin
Mark J. Miller19-Feb-08 8:35
Mark J. Miller19-Feb-08 8:35 
QuestionCan stored procedures retrun more than one value. Pin
Satish - Developer18-Feb-08 23:03
Satish - Developer18-Feb-08 23:03 
AnswerRe: Can stored procedures retrun more than one value. Pin
J4amieC18-Feb-08 23:20
J4amieC18-Feb-08 23:20 
AnswerRe: Can stored procedures retrun more than one value. Pin
Giorgi Dalakishvili18-Feb-08 23:26
mentorGiorgi Dalakishvili18-Feb-08 23:26 

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.