Click here to Skip to main content
15,887,822 members
Home / Discussions / Database
   

Database

 
GeneralRe: Moving Data Between Tables Pin
Wendelius26-Oct-08 2:39
mentorWendelius26-Oct-08 2:39 
AnswerRe: Moving Data Between Tables Pin
PIEBALDconsult29-Oct-08 5:38
mvePIEBALDconsult29-Oct-08 5:38 
GeneralRe: Moving Data Between Tables Pin
Meysam Mahfouzi29-Oct-08 10:20
Meysam Mahfouzi29-Oct-08 10:20 
GeneralRe: Moving Data Between Tables Pin
PIEBALDconsult29-Oct-08 11:39
mvePIEBALDconsult29-Oct-08 11:39 
GeneralRe: Moving Data Between Tables Pin
Meysam Mahfouzi29-Oct-08 17:21
Meysam Mahfouzi29-Oct-08 17:21 
GeneralRe: Moving Data Between Tables Pin
PIEBALDconsult30-Oct-08 4:28
mvePIEBALDconsult30-Oct-08 4:28 
GeneralRe: Moving Data Between Tables Pin
Meysam Mahfouzi30-Oct-08 8:12
Meysam Mahfouzi30-Oct-08 8:12 
GeneralRe: Moving Data Between Tables Pin
PIEBALDconsult30-Oct-08 10:26
mvePIEBALDconsult30-Oct-08 10:26 
Just got around to testing it:

INSERT INTO NewTable (OldID,OldParentID,Description) SELECT * FROM OldTable
SELECT * FROM NewTable
 
UPDATE A
SET ParentID=B.ID
FROM NewTable A
INNER JOIN NewTable B
ON A.OldParentID=B.OldID
 
SELECT * FROM NewTable


It worked on the small amount of data I created to test it:

1	NULL	1	NULL	Section 1
2	NULL	2	NULL	Section 2
3	1	1.a	1	Section 1.a
4	1	1.b	1	Section 1.b
5	2	2.a	2	Section 2.a
6	2	2.b	2	Section 2.b
7	3	1.a.i	1.a	Section 1.a.i
8	3	1.a.ii	1.a	Section 1.a.ii

GeneralRe: Moving Data Between Tables Pin
Meysam Mahfouzi31-Oct-08 19:59
Meysam Mahfouzi31-Oct-08 19:59 
Questionproblem to start a sql server service manager Pin
sathyan_829425-Oct-08 2:19
sathyan_829425-Oct-08 2:19 
AnswerRe: problem to start a sql server service manager Pin
Wendelius25-Oct-08 2:24
mentorWendelius25-Oct-08 2:24 
GeneralRe: problem to start a sql server service manager Pin
sathyan_829425-Oct-08 2:51
sathyan_829425-Oct-08 2:51 
GeneralRe: problem to start a sql server service manager Pin
Wendelius25-Oct-08 4:32
mentorWendelius25-Oct-08 4:32 
QuestionEasier way to clip numeric values to min/max boundaries Pin
ScruffR24-Oct-08 15:21
ScruffR24-Oct-08 15:21 
AnswerRe: Easier way to clip numeric values to min/max boundaries Pin
Syed Mehroz Alam24-Oct-08 17:48
Syed Mehroz Alam24-Oct-08 17:48 
GeneralRe: Easier way to clip numeric values to min/max boundaries Pin
ScruffR26-Oct-08 22:49
ScruffR26-Oct-08 22:49 
GeneralRe: Easier way to clip numeric values to min/max boundaries Pin
PIEBALDconsult29-Oct-08 5:45
mvePIEBALDconsult29-Oct-08 5:45 
AnswerRe: Easier way to clip numeric values to min/max boundaries Pin
Wendelius24-Oct-08 21:24
mentorWendelius24-Oct-08 21:24 
QuestionProbleum in SQL Query Pin
anoopazgar24-Oct-08 1:01
anoopazgar24-Oct-08 1:01 
AnswerRe: Probleum in SQL Query Pin
Ashfield24-Oct-08 1:36
Ashfield24-Oct-08 1:36 
GeneralRe: Probleum in SQL Query Pin
Paul Conrad24-Oct-08 4:49
professionalPaul Conrad24-Oct-08 4:49 
AnswerRe: Probleum in SQL Query Pin
Jason Lepack (LeppyR64)24-Oct-08 1:46
Jason Lepack (LeppyR64)24-Oct-08 1:46 
AnswerRe: Probleum in SQL Query Pin
Blue_Boy24-Oct-08 8:33
Blue_Boy24-Oct-08 8:33 
Question[Message Deleted] Pin
Member 264536523-Oct-08 22:57
Member 264536523-Oct-08 22:57 
AnswerRe: server broker & sql notification Pin
Ashfield23-Oct-08 23:35
Ashfield23-Oct-08 23:35 

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.