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 |
|
krushnapanda
Starting Member
18 Posts |
Posted - 2008-03-13 : 05:15:45
|
| Hi,My Ques: 1My table "Branch" contain a Field name as MassMailit contains mail IDs a@yahoo.com;b@yahoo.com;c@yahoo.com;d@yahoo.com;e@yahoo.comNow plz write me what is the SQL Statement for Retiveing MassMail except one or Two Mail ID Example : Retrive a@yahoo.com;b@yahoo.com;d@yahoo.com;e@yahoo.comHere c@yahoo.com is not IncludeMy Ques: 2My SP isCreate proc sp_Show( @Branch as varchar (200))asSelect field1,field2,field3,field4 From Table1Where BranchCode in (@Branch)Now he to pass the value (@Branch) when execute SPexec sp_Show ?Plz Solve thisThanksThanks |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-13 : 05:30:09
|
| 1. Select Replace(MassMail, 'c@yahoo.com;' ,'') from Branch2. exec sp_Show 'somebranch'Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-03-13 : 06:22:58
|
| If @Branch is csv thenwhere ','+@Branch+',' like '%,'+cast(BranchCode as varchar(10))+'%,'instead ofWhere BranchCode in (@Branch)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|