Solved

Add a column to SQL View (sql 2008r2)

Posted on 2014-01-22
2
839 Views
Last Modified: 2014-01-23
I have a view that I want to add a new column to and be able to enter static values for reference. Thanks for any assistance.

 Example of current view to add new column
0
Comment
Question by:srodgers45
2 Comments
 
LVL 9

Accepted Solution

by:
Vijaya Reddy Pinnapa Reddy earned 500 total points
ID: 39802603
Syntax to add news columns to View
ALTER VIEW dbo.viewname
AS
SELECT originalcolumnlist, ColA+ColB AS col1, ColC+ColD as col2, ColE+ColF as col3, ColG+ColH as col4
FROM yourtable
0
 

Author Closing Comment

by:srodgers45
ID: 39803648
Thank you for the help.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Server / Update DB? 22 38
Problems "swapping" SQL Server DBs 2 24
Where is the Help Section? 8 30
SQL Server syntax 11 14
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question