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)
 How to replace all of a field with value?

Author  Topic 

fonzie
Starting Member

31 Posts

Posted - 2008-10-10 : 11:31:27
How would I replace (SQL) the contents of a field (called rec-id) with value of it's recordnumber?
In vfp it would be "replace all rec-id with str(recno())"

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-10 : 11:39:19
UPDATE table
SET rec_id=rec_number
Go to Top of Page

fonzie
Starting Member

31 Posts

Posted - 2008-10-10 : 12:37:22
I see, just leave out the where clause.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-10 : 12:45:52
quote:
Originally posted by fonzie

I see, just leave out the where clause.


provided you want copy entire contents of a column to another column without any condition checks
Go to Top of Page
   

- Advertisement -