An Idea can change your life.....

Friday, November 27, 2009

How to create a computed column using SQL Server Management Studio?

How to create a computed column using SQL Server Management Studio?

Take the following steps to create a computed column using SQL Server Management Studio:
  1. Run SQL Server Management Studio from Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio.


  2. In the Connect to Server window, click the Connect button.


  3. In the Microsoft SQL Server Management Studio window, double-click the Databases folder.


  4. In the Microsoft SQL Server Management Studio window, double-click the required database. Here, the Axle database is being used.


  5. In the Microsoft SQL Server Management Studio window, double-click the Tables folder.


  6. In the Microsoft SQL Server Management Studio window, right-click the required table and click Modify.


  7. Type the name of the new column. Here, Amount is the new column.


  8. In Column Properties, expand Computed Column Specification. In the Formula box, type the formula. Here, the Price column is multiplied by the Quantity column.


  9. Go to the File menu and click Save Products to save the modifications in the Products table.


No comments: