SQL Statement to Update Where Description Contains "x"

I would like to do a SQL statement to update th SubDescription1 field to be a value if the Description contains a particular string.

For example (not a valid statement):

UPDATE Item SET SubDescription3 = '2807.01.90' WHERE Description CONTAINS 'Screw'

I am not SQL expert, but there must be something like this that will work... Any advice appreciated. (and yes, I know, backup the database before running any SQL UPDATE statement).

Jason

Reply to
Jason
Loading thread data ...

You need to run:

UPDATE Item SET SubDescription3 = '2807.01.90' WHERE Description like '%Screw%'

I suggest a SELECT first to see what rows you will be updating:

SELECT SubDescription3, * FROM Item WHERE Description like '%Screw%'

Cheers Martin

Reply to
Martin

Wonderful. I knew there was a way... Like, not Contains...

Is capitalizati> You need to run:

Reply to
Jason

not in a default install. By default SQL Server is set up to be case insensitive...

Glenn Adams Tiber Creek C> Wonderful. I knew there was a way... Like, not Contains...

Reply to
Glenn Adams [MVP - Retail Mgmt]

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.