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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-04-27 : 08:59:03
|
| annisha writes "i have one tableand i want to insert into table two timesone time in some of the colmnsand the second time in the rest of themwhen i insert it does 2 lines in the tablehow can i do that it will be in one linei did this(insert into) in 2 timesbecause i wanted to check if a name was in the table beforei did a formthen i sent it to asp fileand there i checked if i have this name in my tableif i didnt i did insert to all the tableand if i didnt i did insert to all expet the nameand when they did a valid name at leastthen i did insert just to the nameso i need it one lineand not in twoplease help" |
|
|
drymchaser
Aged Yak Warrior
552 Posts |
Posted - 2004-04-27 : 09:15:22
|
| The first is an INSERT to populate the row with the information you have in the first operation. The second will be an UPDATE to the row you just inserted with the information updating the remaining columns.Or if possible you could combine the two operations into one INSERT. |
 |
|
|
|
|
|