| Author |
Topic |
|
tytyguy
Starting Member
13 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tytyguy
Starting Member
13 Posts |
Posted - 2008-07-19 : 23:54:00
|
| I tried that and get this error...Msg 8116, Level 16, State 1, Line 1Argument data type ntext is invalid for argument 1 of replace function.http://www.tunerplaza.com |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-20 : 02:05:14
|
| http://www.sqlservercentral.com/articles/Miscellaneous/handlingthetextdatatype/985/ |
 |
|
|
tytyguy
Starting Member
13 Posts |
Posted - 2008-07-20 : 13:57:26
|
| im kinda new to it. None of those seem to work.http://www.tunerplaza.com |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-20 : 14:05:20
|
Since you are using SQL Server 2005, try to replace TEXT datatype with VARCHAR(MAX). E 12°55'05.25"N 56°04'39.16" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-20 : 14:06:44
|
quote: Originally posted by tytyguy im kinda new to it. None of those seem to work.http://www.tunerplaza.com
not even UPDATETEXT. Did you have a look at sample given in the link? |
 |
|
|
tytyguy
Starting Member
13 Posts |
Posted - 2008-07-20 : 16:25:51
|
| yes. theres 3 different codes. not sure which one I need. I cant find where to put it my values. I want to change '2953976' to '3052631'http://www.tunerplaza.com |
 |
|
|
tytyguy
Starting Member
13 Posts |
Posted - 2008-07-20 : 18:21:02
|
| this works....# select cast(replace(cast(mycolumn as nvarchar(max)),'2953976','3052631') as ntext) # from mytablehttp://www.tunerplaza.com |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-20 : 19:22:06
|
What databas are you using, if # character is part of query? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
tytyguy
Starting Member
13 Posts |
Posted - 2008-07-20 : 23:16:35
|
| I retract that. It replaced it but did not insert it back into the column. So its still open that I have no idea what to do.http://www.tunerplaza.com |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-07-20 : 23:21:26
|
| A SELECT does nothing more than return data. It does not update data. If you want to update data, then you must use an UPDATE statement.But why don't you just change your column's data type? Why did you need ntext?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
tytyguy
Starting Member
13 Posts |
Posted - 2008-07-21 : 00:13:32
|
| not sure. I did not make the database. Its aspdotnetstorefront ecommerce software. I do not believe it would smart to change it around. Im sure there is a solution for this....http://www.tunerplaza.com |
 |
|
|
Thiyagu_04
Starting Member
37 Posts |
Posted - 2008-07-21 : 07:13:12
|
| select cast(replace(cast(val as nvarchar(max)),'265235','552355') as ntext) from tablename |
 |
|
|
|