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
 help with string manipulation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dardar
Starting Member

Israel
10 Posts

Posted - 05/10/2012 :  03:32:23  Show Profile  Reply with Quote
hi guys. need help with the following scenario:

i got a table with 1 column which is a string . foe example:

"name=xxx gender=M pass=abcde" //for table A
"name=yyy gender=M pass=a456" //for table b

and lets sany i have alot of tables like those.

i need to find a way to delete only the "pass" value from each table with a 1 sql query (i.e 1 query which i will run on every DB)

the result should be:
"name=xxx gender=M pass=" //for table A
"name=yyy gender=M pass=" //for table b

thx for the help!

RickD
Slow But Sure Yak Herding Master

United Kingdom
3560 Posts

Posted - 05/10/2012 :  05:22:05  Show Profile  Reply with Quote
Look up PATINDEX() to see how you would go about finding the starting point for your query, then you could use CHARINDEX starting at this point to find the next ", this would give you a start and end position, you could then SUBSTRING() everything before and after these points.
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.05 seconds. Powered By: Snitz Forums 2000