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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Re: Post plz solve

Author  Topic 

krushnapanda
Starting Member

18 Posts

Posted - 2008-03-13 : 05:15:45
Hi,
My Ques: 1
My table "Branch" contain a Field name as MassMail
it contains mail IDs a@yahoo.com;b@yahoo.com;c@yahoo.com;d@yahoo.com;e@yahoo.com

Now 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.com
Here c@yahoo.com is not Include

My Ques: 2
My SP is
Create proc sp_Show
( @Branch as varchar (200))
as
Select field1,field2,field3,field4 From Table1
Where BranchCode in (@Branch)

Now he to pass the value (@Branch) when execute SP
exec sp_Show ?


Plz Solve this
Thanks



Thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-13 : 05:30:09
1. Select Replace(MassMail, 'c@yahoo.com;' ,'') from Branch
2. exec sp_Show 'somebranch'

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-03-13 : 06:22:58
If @Branch is csv then

where ','+@Branch+',' like '%,'+cast(BranchCode as varchar(10))+'%,'

instead of

Where BranchCode in (@Branch)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -