Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Can i use Computed Field in SQL
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

58 Posts

Posted - 11/14/2013 :  01:46:06  Show Profile  Reply with Quote
My table MEMBER_REGISTRATION has MemberId field is a computed field.

But i used my query like

if @position='Left'
update MEMBER_REGISTRATION set LEFTJOIN=@memberid where MEMBERID=@sponsor
update MEMBER_REGISTRATION set RIGHTJOIN=@memberid where MEMBERID=@sponsor

But i got error.

The column "MEMBERID" cannot be modified because it is either a computed column or is the result of a UNION operator.

I dont knw how use it.
Kindly help me.

Thanks in advance

In (Som, Ni, Yak)

17689 Posts

Posted - 11/14/2013 :  01:58:41  Show Profile  Reply with Quote
can you show us the DDL for MEMBER_REGISTRATION ?

Time is always against us

Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 11/14/2013 :  02:21:55  Show Profile  Reply with Quote
can you explain what you're trying to do?
Both of your posted statements make no sense

SQL Server MVP
Go to Top of Page

Yak Posting Veteran

58 Posts

Posted - 11/14/2013 :  10:22:12  Show Profile  Reply with Quote
Go to Top of Page

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 11/14/2013 :  10:39:18  Show Profile  Reply with Quote
couple things:

- a computed column can not be modified. To modify the value you would need to modify the column value(s) that are involved in the definition expression.

- the error you specified doesn't match up with the statements you posted. That error indicates that you are updating the [memberid] column but neither statement is modifying that column.

Be One with the Optimizer
Go to Top of Page

Yak Posting Veteran

58 Posts

Posted - 11/14/2013 :  11:20:24  Show Profile  Reply with Quote
Thank you
Ya. Thats why Iam asking.
Go to Top of Page

Paul J. Brooks
Starting Member

7 Posts

Posted - 11/25/2013 :  06:16:50  Show Profile  Reply with Quote
Yes you can use the computed Field in SQL.I wanna discus on this topic if any one interested then reply me i m waiting.I think this is a good approach.Thanks for sharing this information.


Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000