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 2008 Forums
 Transact-SQL (2008)
 Mass Update SQL

Author  Topic 

McBeef
Starting Member

14 Posts

Posted - 2011-06-22 : 18:51:33
Is there a SQL statement that will copy all the data from one column into another? Or can something like this only be accomplished with stored procedures? In either case, how would I go about doing this? The reason is that I need to copy dates formatted as nvarchar into another column formatted as datetime and eventually deleting the original column. If I just try to change the data type it get an error message explaining that the table needs to be dropped and recreated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-22 : 18:53:56
UPDATE Table1
SET Column3 = 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

McBeef
Starting Member

14 Posts

Posted - 2011-06-22 : 19:13:09
Worked great, thanks.
Go to Top of Page
   

- Advertisement -