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
 General SQL Server Forums
 New to SQL Server Programming
 column value

Author  Topic 

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2006-04-18 : 08:26:27

select ssn from members
i get string filed of value '264-93-2932' how can i make as '264932932' in the table
ie : when i give
select ssn from members
i want as '264932932'

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-18 : 08:30:23
select Replace(ssn,'-','') from members


Srinika
Go to Top of Page

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2006-04-18 : 08:34:21
Thanks .,
I want to change the field value itself

I try
updates members set ssn = Replace(ssn,'-','')

error :
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '='.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-04-18 : 08:42:47
updates members set ssn = Replace(ssn,'-','') 




KH


Go to Top of Page

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2006-04-18 : 08:49:57
Thanks ... i have found .. the error after i post .. thanks for the reply
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-18 : 09:00:59
It is better to keep the data as they are and only use replace function when querying

shanmugaraj, most of your questions seem to be easy. Only thing is you need to learn SQL fully. Also make use of sql server help file

http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -