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
 Database Design and Application Architecture
 Create a column in a view without data

Author  Topic 

Linok
Starting Member

34 Posts

Posted - 2008-02-28 : 08:36:48
Hey everyone,

I have a view that shows the email address and first name of a Membership table. I need to add a column to this view that doesn't have a corresponding column in the original table that has some default value.

i.e. the view currently shows:

John john@something.com

I need it to say:

John john@something.com EmailBlast

The third column will always have that value.

Anyone have a suggestion?

Thanks in advance!

--J

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-02-28 : 08:37:45
[code]create view dbo.test1
as
select col1, col2, 'EmailBlast' as col3
from table[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Linok
Starting Member

34 Posts

Posted - 2008-02-28 : 10:10:12
Thanks for the crazy-fast answer!
Go to Top of Page
   

- Advertisement -