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.
| Author |
Topic |
|
coagulance
Yak Posting Veteran
78 Posts |
Posted - 2009-06-04 : 08:38:08
|
| Hi,I have a Master table with the below fields:JobType SeqNo DetailsAAA 1 EuropeAAA 2 AsiaAAA 3 S.AAAC 1 nzlAAC 2 OzI need to insert all records of the Master Table in to a Running Table with only the Job Number changed like below:JobType SeqNo DetailsAAA0901 1 EuropeAAA0901 2 AsiaAAA0901 3 S.A(I have written the function to create the JobType from Job Number)Any suggestions other than using Cursors ?Thanks, |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-04 : 08:42:57
|
INSERT RunningTable (JobType, SeqNo, Details)SELECT JobType + '0901' AS JobType, SeqNo, DetailsFROM MasterTable E 12°55'05.63"N 56°04'39.26" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-06-04 : 08:44:48
|
| You dont need a seperate tableJust use select queryselect jobtype + '0901' as jobtype, seqno, details from your_tableMadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-06-04 : 08:45:45
|
MadhivananFailing to plan is Planning to fail |
 |
|
|
coagulance
Yak Posting Veteran
78 Posts |
Posted - 2009-06-04 : 09:30:44
|
| Thanks Peso! |
 |
|
|
|
|
|