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
 Transact-SQL (2005)
 Select/Update on same table data

Author  Topic 

meemo
Starting Member

9 Posts

Posted - 2011-11-15 : 16:51:53
Silly question, but I couldn't figure it out really.

I basically need to just resave all the data in 1 column in 1 table on the same DB in order to fix data.

So, for example, if my table is: People
And my column is: Company
And my table has this data:

ID Company
1 abc
2 def
3 ghi
4 jkl
5 mno

I want to get each row, and save it again, one after another in a select/update query.

I did some research but didn't find a suitable answer. Please help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-15 : 17:03:43
It is pointless to do this if you are saving the same data.

UPDATE Table1 SET Column1 = Column1, Column2 = Column2

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

meemo
Starting Member

9 Posts

Posted - 2011-11-15 : 17:21:01
Thanks but re-saving existing data was necessary to fix encoding issues through a different underlying platform than the previous one.
Go to Top of Page
   

- Advertisement -