Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Add a column to SQL View (sql 2008r2)

Posted on 2014-01-22
2
Medium Priority
?
1,397 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 2000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

885 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