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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to update rows in a table

Author  Topic 

kkiranvr
Yak Posting Veteran

54 Posts

Posted - 2007-11-26 : 17:54:34
We have a table and it is having records with for example “Chase“, now we don’t want those “ “ and we want just Chase instead, so how can we update the records? Is there any other easy way to do than cursor?

Here I have got code for Cursor, but I am not getting the logic what to keep. And the code is here


declare @tbl varchar(200)

declare cur cursor for select name from sysobjects where type='U' and name like 'NS%'

open cur

fetch next from cur into @tbl

while @@FETCH_STATUS = 0

begin

print @tbl

--exec sp_spaceused @tbl

fetch next from cur into @tbl

end

close cur

deallocate cur



Can you please send me the logic?
It will be more appreciable.


-Thanks N Regards,
Kanthi.

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-27 : 02:05:13
Don't need cursor, try with replace function.
Go to Top of Page
   

- Advertisement -