Solved

Add calculating column to table in SQL 2008

Posted on 2011-09-09
3
307 Views
Last Modified: 2012-05-12
How can I add a calculating column to an existing table in sql 2008??

I know how to design and how to insert a column and name it.

Now I want it to take a number in the column called inspection_sample_breakdown_rock_dirt_foreign_material_percent
and multiply it by the number in a column called
contract_information_total_weight

Any help with this??
0
Comment
Question by:HDM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 500 total points
ID: 36513742
That would be somethinmg like:

ALTER TABLE dbo.TableName
ADD new_column_name AS inspection_sample_breakdown_rock_dirt_foreign_material_percent*contract_information_total_weight

0
 

Author Comment

by:HDM
ID: 36513774
I am assuming I would need to change the inspection_sample_breakdown_rock_dirt_foreign_material_percent data type to an int??
0
 

Author Closing Comment

by:HDM
ID: 36513988
Perfect!!  Thanks!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 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