Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Duplicating records in the same table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-03 : 08:16:30
mkp2004 writes "I have a problem with my DTS export....
Here I have a table

employee table

id Employee_id Name age Sex
1 300 Manu 23 m
2 301 Anu 45 f
3 302 Vinu 56 m


Now I want to duplicate the records in this table just by changing the employee_id(eg:- adding 1000 to the 1st 3records. Now I will have a data set. Like that I want to make 100 sets. It will look like....

employee table

id Employee_id Name age Sex
1 300 Manu 23 m
2 301 Anu 45 f
3 302 Vinu 56 m
4 300+1000 Manu 23 m
5 301+1000 Anu 45 f
6 302+1000 Vinu 56 m
7 300+2000 Manu 23 m
8 301+2000 Anu 45 f
9 302+2000 Vinu 56 m
.........................................
.........................................

Like that 10 sets of data. here if u notice the only change is the employee_id where it should be made in a loop to generate 10 sets.

This is needed as a creteria for DTS..So please help me very urgently "

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-06-03 : 19:12:46
Duplicate:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=35600
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-06-03 : 19:14:12
Have you noticed all these posts have the same weird name examples. lol I'm thinking HOOOOOOMEWORK!!!

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2004-06-03 : 19:48:39
You wouldn't use dts for this unless it was an artificial question.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -