SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

Arunavally
Yak Posting Veteran

India
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
else
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

khtan
In (Som, Ni, Yak)

Singapore
17644 Posts

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


KH
Time is always against us

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 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
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Arunavally
Yak Posting Veteran

India
58 Posts

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

TG
Flowing Fount of Yak Knowledge

USA
6062 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
TG
Go to Top of Page

Arunavally
Yak Posting Veteran

India
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

USA
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.

-----------------

unspammed
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.11 seconds. Powered By: Snitz Forums 2000