Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI'm trying to add a formula to a column in a Table, in Enterprise Manager, but I'm not being allowed. I want a column to be multiplication of two other columns, datatypes money and decimal. I'm typing SubTotal * TaxRate .... What's the big deal with this?
Post Follow-up to this messageHi Calvin As per my knowledge you cannot add formula to the table. You can do this in your query. If u feel you use the formula frequently, u can create a VIEW of UDF Hope this will solve your problem. Thanks and regards Chandra "Calvin" wrote: > I'm trying to add a formula to a column in a Table, in Enterprise Manager, > but I'm not being allowed. > > I want a column to be multiplication of two other columns, datatypes money > and decimal. > > I'm typing SubTotal * TaxRate .... > > What's the big deal with this? > > >
Post Follow-up to this messageTry using Query Analyzer and execute the CREATE TABLE statement instead, the n you can post an error message for us. Below work fine on my machine: CREATE TABLE #t (subtotal decimal(5,3) ,taxrate int ,x AS subtotal*taxrate) An alternative is to present derived information in views instead of in the table... -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www. solidqualitylearning .com/ "Calvin" <calvin@discussions.microsoft.com> wrote in message news:BE975F7D. 1622%calvin@discussi ons.microsoft.com... > I'm trying to add a formula to a column in a Table, in Enterprise Manager, > but I'm not being allowed. > > I want a column to be multiplication of two other columns, datatypes money > and decimal. > > I'm typing SubTotal * TaxRate .... > > What's the big deal with this? > >
Post Follow-up to this messageYeah... realized that would save the hassle after my post. Thanks for your reply. On 29/4/05 7:06 am, in article 5042C552-DDBF-4D63-BE77- C8B6ECDAF946@microso ft.com, "Chandra" <Chandra@discussions.microsoft.com> wrote: > Hi Calvin > As per my knowledge you cannot add formula to the table. You can do this in > your query. > > If u feel you use the formula frequently, u can create a VIEW of UDF > > Hope this will solve your problem. > > Thanks and regards > Chandra > > > "Calvin" wrote: >
Post Follow-up to this messageDecided to change the query which updates the table instead, but thanks fr your reply. On 29/4/05 9:19 am, in article O6qYcQJTFHA.3056@TK2MSFTNGP14.phx.gbl, "Tibor Karaszi" <tibor_please.no. email_karaszi@hotmai l.nomail.com> wrote: > Try using Query Analyzer and execute the CREATE TABLE statement instead, t hen > you can post an error > message for us. Below work fine on my machine: > > CREATE TABLE #t > (subtotal decimal(5,3) > ,taxrate int > ,x AS subtotal*taxrate) > > An alternative is to present derived information in views instead of in th e > table...
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread