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 |
|
eugz
Posting Yak Master
210 Posts |
Posted - 2011-02-11 : 11:16:00
|
| Hi All.I have Table1: ID Result-------------1 AAAA2 BBBB3 CCCCAnd I would like to create SP. If variable ID=1, the result of select will:2 BBBB3 CCCCIf variable ID=2, the result of select will:2 AAAA3 CCCCand so on. How it to do?Thanks. |
|
|
Sachin.Nand
2937 Posts |
Posted - 2011-02-11 : 11:30:29
|
| select * from yourtable where id != @IdPBUH |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-02-12 : 03:20:06
|
| hope you will pass only single value through ID and not a list------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-14 : 04:58:39
|
| <<If variable ID=2, the result of select will:2 AAAA3 CCCC>>How will Id for AAA be 2?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|