Monday, March 19, 2012

functions in view

I have a view on SQL server 2000.
Using enterprise mngr to admin it.
In my view I would like to add a column that calculates something with the
other column.
An example could be:
Column Table
a x
b x
a1 y
mycustomcolumn = (a+b)*a1 =>> how can I insert this.
It's a bit like in Ms Access, where you have the expression builder.
THXnicholas wrote:
> I have a view on SQL server 2000.
> Using enterprise mngr to admin it.
> In my view I would like to add a column that calculates something
> with the other column.
> An example could be:
> Column Table
> a x
> b x
> a1 y
> mycustomcolumn = (a+b)*a1 =>> how can I insert this.
> It's a bit like in Ms Access, where you have the expression builder.
> THX
create table test123 (col1 int, col2 int)
create view vTest
as
Select col1, col2, col3 = col1 * col2
From test123
Don't rely on SQL EM for object maintenance. Learn to use actual DDL
scripting. SQL EM doesn't do everyting and maintaining from scripts give
you a good handle on object design.
David Gugick
Imceda Software
www.imceda.com|||perfect !
THX a lot
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:%23Zy9QfsEFHA.3924@.TK2MSFTNGP09.phx.gbl...
> nicholas wrote:
> > I have a view on SQL server 2000.
> > Using enterprise mngr to admin it.
> >
> > In my view I would like to add a column that calculates something
> > with the other column.
> > An example could be:
> >
> > Column Table
> > a x
> > b x
> > a1 y
> > mycustomcolumn = (a+b)*a1 =>> how can I insert this.
> >
> > It's a bit like in Ms Access, where you have the expression builder.
> >
> > THX
> create table test123 (col1 int, col2 int)
> create view vTest
> as
> Select col1, col2, col3 = col1 * col2
> From test123
>
> Don't rely on SQL EM for object maintenance. Learn to use actual DDL
> scripting. SQL EM doesn't do everyting and maintaining from scripts give
> you a good handle on object design.
>
> --
> David Gugick
> Imceda Software
> www.imceda.com
>

No comments:

Post a Comment