Solved

Add a column to SQL View (sql 2008r2)

Posted on 2014-01-22
2
639 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now