Click here to Skip to main content
15,902,445 members
Home / Discussions / Database
   

Database

 
Generalbetter way for moving data from one to three table Pin
mohd imran abdul aziz19-Feb-08 21:45
mohd imran abdul aziz19-Feb-08 21:45 
GeneralAutoincrement character type data in sql server Pin
techie.priyanka19-Feb-08 20:17
techie.priyanka19-Feb-08 20:17 
GeneralRe: Autoincrement character type data in sql server Pin
Hesham Amin19-Feb-08 20:53
Hesham Amin19-Feb-08 20:53 
GeneralRe: Autoincrement character type data in sql server Pin
techie.priyanka21-Feb-08 22:18
techie.priyanka21-Feb-08 22:18 
GeneralRe: Autoincrement character type data in sql server Pin
Hesham Amin21-Feb-08 22:29
Hesham Amin21-Feb-08 22:29 
Generalhelp in inserting into a table Pin
mrcsn19-Feb-08 20:12
mrcsn19-Feb-08 20:12 
GeneralRe: help in inserting into a table Pin
Krish - KP19-Feb-08 20:16
Krish - KP19-Feb-08 20:16 
GeneralRe: help in inserting into a table Pin
mrcsn19-Feb-08 21:24
mrcsn19-Feb-08 21:24 
GeneralAutomatic email sending function Pin
Jamman19-Feb-08 19:50
Jamman19-Feb-08 19:50 
GeneralRe: Automatic email sending function Pin
Steven J Jowett20-Feb-08 4:52
Steven J Jowett20-Feb-08 4:52 
Generalsql inserting Pin
mrcsn19-Feb-08 18:12
mrcsn19-Feb-08 18:12 
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 

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.