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 2000 Forums
 SQL Server Development (2000)
 can this be done?

Author  Topic 

mikec
Starting Member

5 Posts

Posted - 2002-05-29 : 09:42:24
in a database table called 'meter_table' i have a database column holding meter numbers (meter_number)and another holding supply status (supply_status). i am trying to update supply status for several meter numbers simultaneously by using the query:

UPDATE meter_table SET supply_status='ACTIVE BILLING' WHERE meter_number LIKE '%13131312,5323242,645645,456546,7657575%'

but i believe this query looks for a meter number of the complete '%13131312,5323242,645645,456546,7657575%' value rather than picking up a particular individual meter numbers from within the '%13131312,5323242,645645,456546,7657575%' value.

Is it possible to create a query that picks up any meter number from within the '%13131312,5323242,645645,456546,7657575%' value (for example) and updates supply status for each matching meter number within the meter_number column?

Help would be much appreciated.

Mike




Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-05-29 : 09:45:25

UPDATE meter_table
SET supply_status='ACTIVE BILLING'
WHERE meter_number in (13131312,5323242,645645,456546,7657575)

 
<O>

Edited by - Page47 on 05/29/2002 09:45:58
Go to Top of Page

mikec
Starting Member

5 Posts

Posted - 2002-05-29 : 10:14:12
Thanks for the fast reply.

I've tried your suggestion and it does exactly what I wanted.

Many thanks for your help!

Mike


UPDATE meter_table
SET supply_status='ACTIVE BILLING'
WHERE meter_number in (13131312,5323242,645645,456546,7657575)
[/code]
 
<O>

Edited by - Page47 on 05/29/2002 09:45:58
[/quote]

Go to Top of Page
   

- Advertisement -