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
 General SQL Server Forums
 New to SQL Server Programming
 how to use like '%%' with update statement?

Author  Topic 

samsun125
Yak Posting Veteran

63 Posts

Posted - 2008-11-05 : 04:19:19
Hi all,

I have one doubt , i want to update my table

update employeedetails set employeemailid='Not Available' where employeemailid='Http://'

can u please help me

Thanks & Regards

SAMS

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-05 : 04:21:33
did you mean this?

update employeedetails set employeemailid='Not Available' where employeemailid like 'Http://%'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-05 : 04:26:07
quote:
Originally posted by samsun125

Hi all,

I have one doubt , i want to update my table

update employeedetails set employeemailid='Not Available' where employeemailid='Http://'

can u please help me

Thanks & Regards

SAMS



What did happen when you run the query?
Did you get any error?


Madhivanan

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

samsun125
Yak Posting Veteran

63 Posts

Posted - 2008-11-05 : 04:28:59
hi ,

now in my database employeemailid is starts with like this http://www.

what i want is i want to update this column with 'Not Available' where it starts with http://www.......


Regards
SAMS
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-05 : 04:29:55
update employeedetails set employeemailid='Not Available' where employeemailid like 'http://www.%'


Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-05 : 04:30:46
then use my suggestion posted earlier.
Go to Top of Page

samsun125
Yak Posting Veteran

63 Posts

Posted - 2008-11-05 : 04:32:36
Hi madhavan,

i used this querys

update tblemployeemailid set employeemailid='Not Available' where employeemailid='Http://'


update tblemployeemailid set employeemailid='Not Available' where employeemailidlike '%Http://%'


for the above 2 querys i got same error:Invalid column name employeemailid.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-05 : 04:36:21
Do you have that column in the table?

Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-05 : 04:38:14
you should have a space between column nams and like

update tblemployeemailid set employeemailid='Not Available' where employeemailid like '%Http://%'
Go to Top of Page

samsun125
Yak Posting Veteran

63 Posts

Posted - 2008-11-05 : 04:46:03
yaa i have madhavan,

before modifying my table values i want to take backup of that table.

how to do can u give me idea...........
Go to Top of Page

samsun125
Yak Posting Veteran

63 Posts

Posted - 2008-11-05 : 05:46:25
HI all,
Thank your very much who replied to my query

i modified table values using this below query

update tblemployeemailid set employeemailid='Not Available' where employeemailid like'Http:%'

Regards
sams
Go to Top of Page
   

- Advertisement -