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 |
|
Limuh
Yak Posting Veteran
94 Posts |
Posted - 2008-04-17 : 00:03:27
|
| SELECT @tempcc = CostCenterNbr FROM Tbl_PeopleI try to get all the data in the Table. but i only get the last data in the row. All i want is to get all the data from first to last. please help thank you. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-17 : 00:11:54
|
| SELECT * INTO #Temp FROM Tbl_People gets all data from your table to temporary tableYou can store only one value in a variable. Thats why it stores and gives you last value when you do assignment as above. |
 |
|
|
Limuh
Yak Posting Veteran
94 Posts |
Posted - 2008-04-17 : 02:15:30
|
| let me clear up the problem sorry.im making a stored procedure. i have a table1 where i get the phone number and insert that phone number to the other table2. The problem of my query is that it only inserted the last phonenumber to table@ and i want all the phone number will be inserted to the table. Please help. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-17 : 03:01:08
|
| UPDATE t2SET t2.phonenumber=t1.phonenumberFROM table2 t2INNER JOIN table1 t1ON t1.commoncol=t2.commoncol |
 |
|
|
|
|
|