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 |
|
laptop545
Starting Member
11 Posts |
Posted - 2010-03-19 : 12:45:02
|
| Hello All, i am writing a db script and i have problem in between it.I have a temp table ( created from output from another SP), with values say:ID1234123512361237Now i want this following query for every value in the above table :Insert into P_PEOPLE (id,name,user) values ((every value in the above table), .........)how should i do this, because some times, the above table may consist many rows like say 100. |
|
|
smmcroberts
Starting Member
3 Posts |
Posted - 2010-03-19 : 12:50:06
|
| Where are you getting the name and user?You can insert the ID by using an insert/select:Insert into P_PEOPLE (id,name,user)select id, ~name-source~, ~user-source~ from temp-tableBut that leaves an open question on the name and user values.--Steve |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-19 : 12:55:26
|
| Insert into P_PEOPLE (id,name,user) SELECT id,name,user FROM #yourTemptable------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-19 : 12:56:13
|
OOps..I didnt refresh ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|