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
 General SQL Server Forums
 New to SQL Server Programming
 Temp variable with computed columns

Author  Topic 

anujpratap84
Starting Member

45 Posts

Posted - 2012-01-16 : 13:43:10
Hi All,

I want to create a temp variable or temp table with number of computed columns.

Is it possible? if yes.
How i do this?

Thanks in advance..

Anuj Pratap Singh

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2012-01-16 : 14:01:00
[code]DECLARE @Foo TABLE
(
Val1 INT,
Val2 INT,
Val3 AS Val1 + Val2,
Val4 AS Val1 * Val2
)
[/code]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-16 : 14:11:46
quote:
Originally posted by anujpratap84

Hi All,

I want to create a temp variable or temp table with number of computed columns.

Is it possible? if yes.
How i do this?

Thanks in advance..

Anuj Pratap Singh


hope you know the difference between two
which one you want to use in your case?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -