SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql update question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sanamfrens
Starting Member

USA
2 Posts

Posted - 10/09/2013 :  17:59:12  Show Profile  Reply with Quote
I need an update script for the following problem in sql server environment . Could anyone please help….
When ‘mobile phone’ exists, change to ‘home’. When ‘mobile phone’ does not exists then change to ‘mobile phone’

Lamprey
Flowing Fount of Yak Knowledge

4612 Posts

Posted - 10/09/2013 :  18:19:07  Show Profile  Reply with Quote
http://www.sqlservercentral.com/articles/Best+Practices/61537/
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 10/10/2013 :  01:23:14  Show Profile  Reply with Quote
which table? which column? without all these information how can you expect someone to help?

Post some sample data and show how you want output to come.

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

sanamfrens
Starting Member

USA
2 Posts

Posted - 10/10/2013 :  11:59:58  Show Profile  Reply with Quote
sorry visakh, I am new to sql so did not know what I need to provide as a source. please find the table name and column name:
In phone Address table there is one phone_type column exists there.
In phone_type column there are different types of phone records are there eg: mobile, home, fax, business, temporary
Now,
in phone_type column,
When ‘mobile phone’ exists, change to ‘home’. When ‘mobile phone’ does not exists then change to ‘mobile phone’
other type should be as it is.
Thank you in advance.
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs

[/quote]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 10/10/2013 :  14:17:09  Show Profile  Reply with Quote
so are you telling at the end of change you'll just have only two types? home and mobilephone?

Please help us to help you by giving some sample data in below format

http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000