Siddhesh Posted April 10, 2006 Share Posted April 10, 2006 Hi,I have a table Student With Column Student NameI want to do is thatThe Names Starting with 'S' , should start with 'K'e.g Students names areSid, Subbu, Sigma, suki..Then should be convert toKid, Kubbu, Kigma, Kuki....Thanx,Waiting... Link to comment Share on other sites More sharing options...
aspnetguy Posted April 10, 2006 Share Posted April 10, 2006 you can do that with a server side language. Select the names starting with s then do string manipulation and then update the records again. Link to comment Share on other sites More sharing options...
Siddhesh Posted April 10, 2006 Author Share Posted April 10, 2006 you can do that with a server side language. Select the names starting with s then do string manipulation and then update the records again.<{POST_SNAPBACK}> Thanx, that could be a solution.But I don't want to make any site, but only data-cleaning.Can I do it?Any other solution? I m Using SQL 2000 Link to comment Share on other sites More sharing options...
sivasairam Posted April 13, 2006 Share Posted April 13, 2006 As per my understanding ur query,I feel that this is the solution:UPDATE Student SET Student_Name= Replace(Initcap(Student_Name),'S','K') WHERE Initcap(UNIQUE_NAME) LIKE 'S%'Even without the where clause it will work...But to increase the readability , i have added it Link to comment Share on other sites More sharing options...
Siddhesh Posted April 15, 2006 Author Share Posted April 15, 2006 UPDATE Student SET Student_Name= Replace(Initcap(Student_Name),'S','K') WHERE Initcap(UNIQUE_NAME) LIKE 'S%'<{POST_SNAPBACK}> Your aim of answer is Perfect, But the querry is giving me error as"'Initcap' is not a recognized function name."Can U help me? Link to comment Share on other sites More sharing options...
injesus Posted May 4, 2006 Share Posted May 4, 2006 declare @nombret varchar(25)UPDATE prueba2set @nombret=substring(nombre,2,24),nombre=Replace(substring(nombre,1,1),'c','r')+@nombretWHERE nombre LIKE 'c%'@nombret is a temporal variableprueba2 is the tablenombre it is the only field that is modifiedsubstring select from nombre the firt caracter and the rest set to @nombretand only it modifies the first characterI hope can help you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now