• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

Add calculating column to table in SQL 2008

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
Curtis Long
Asked:
Curtis Long
  • 2
1 Solution
 
lcohanDatabase AnalystCommented:
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
 
Curtis LongAuthor Commented:
I am assuming I would need to change the inspection_sample_breakdown_rock_dirt_foreign_material_percent data type to an int??
0
 
Curtis LongAuthor Commented:
Perfect!!  Thanks!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now