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 |
khanewal
Starting Member
33 Posts |
Posted - 2010-08-19 : 21:06:29
|
TABLE:1 A B C HIG2 C D E RED3 D E F RED4 I J K HIGConditional Query:IF COLUMN5 = 'HIG'INSERT INTO (COL1, COL2, COL3)ELSE INSERT INTO (COL1,COL2,COL3)Can you please let me know how I will implement this query in SQL Server |
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-08-20 : 03:30:38
|
You are trying to insert into which table and what values ?Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-08-20 : 04:19:23
|
INSERT AuxiliaryTable (Col1, Col2, Col3SELECT Col2, Col3, Col4 FROM Table WHERE Col5 = 'HIG'INSERT AnotherAuxiliaryTable (Col1, Col2, Col3SELECT Col2, Col3, Col4 FROM Table WHERE Col5 <> 'HIG' N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|