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 2012 Forums
 Transact-SQL (2012)
 Find/Replace issue

Author  Topic 

salvjr
Starting Member

2 Posts

Posted - 2013-06-14 : 16:15:20
I want to thank everyone in advance for your assistance in this matter. I'm running MS SQL 2k. In a database called consumer there is a table called consumerdata. In the telephone column there are phone numbers, but at times some fields are null and some just contain a zero 0. I'm trying to replace the rows that contain only a 0 with nothing, but I don't want to effect a row of data that happens to contain a zero such as 9544801001 as that has to be left untouched. And ideas for a t-sql script? Also I should mention there are 160 million rows :(

Thanks everyone... Sal

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-06-14 : 16:49:14
[code]UPDATE ConsumerData
SET PhoneNumber = NULL
WHERE PhoneNumber = '0'[/code]
Go to Top of Page

salvjr
Starting Member

2 Posts

Posted - 2013-06-15 : 15:01:25
You are awesome! Thank you so much! Works perfectly!!
Go to Top of Page

kittu
Starting Member

1 Post

Posted - 2013-06-18 : 03:51:08
For each maker, list in the alphabetical order with "/" as delimiter all the types of products he produces.
Deduce: maker, product types' list


· Help topics:
GROUP BY clause
COALESCE operator
REPLACE function
Getting summarizing values

answer my query
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-18 : 03:54:56
quote:
Originally posted by kittu

For each maker, list in the alphabetical order with "/" as delimiter all the types of products he produces.
Deduce: maker, product types' list


· Help topics:
GROUP BY clause
COALESCE operator
REPLACE function
Getting summarizing values

answer my query



DOnt hijack threads
Post as a new thread if you've a question
In any case we wont hlep with homework/assignments unless you try it out yourself

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -