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 2000 Forums
 Transact-SQL (2000)
 How to remove Computed Formula for a field

Author  Topic 

ismail_issac
Starting Member

22 Posts

Posted - 2005-09-13 : 07:26:40
Hi

How do i remove the Computed formula for a field. I tried to achieve in the follwing way, but could not upodate the column

EXEC sp_configure 'allow update', '1'
RECONFIGURE WITH OVERRIDE

update syscolumns set iscomputed = 0 where name='DescA' and id=(select id from sysobjects where name='area')

EXEC sp_configure 'allow update', '0'
RECONFIGURE WITH OVERRIDE


How to update "iscomputed" column from syscolumns object. OR please tell me if there is any other way to achieve it

Thanks in advance

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-09-13 : 07:33:02
NEVER update the system tables directly. You risk corrupting your SQL Server.

A computed column does not store values, you cannot just change the computed property and have it retain anything. The only way to do that is to add a regular column of the right datatype, UPDATE the table to put the computed value in that new column, then drop the computed column.
Go to Top of Page
   

- Advertisement -