Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Scripting the definition of computed columns

Oct 25 2013 12:00AM by Madhivanan   

One of my friends asked me if there is an easier way of knowing the definion of the computed column. Currently what he does is to script out the table definition and looks for the definition of computed column. Well. There is an easy way of finding it. You just need to query the system catelog view sys.computed_columns.  

Consider the following table

create table emp_salary(emp_id int, basic_sal decimal(12,2),bonus as 0.10*basic_sal)
If you want to know the definitions of the computed columns of the table emp_salary, use the query
select 
	object_name(object_id) as table_name,name as column_name,definition  
from 
	sys.computed_columns where object_id=object_id('emp_salary')
The result is
table_name                column_name    definition
------------------------- -------------  ----------------
emp_salary                bonus          ((0.10)*[basic_sal])
You may be interested to read this post too Quick way to know all computed columns across tables

Tags: 


Madhivanan
2 · 40% · 12993
3
 
0
Lifesaver
 
0
Refreshed
 
 
0
Incorrect



Submit

2  Comments  

  • Nice article, Thanks for sharing. There is also an alternative way to do it. Given below is the script.

    spHelptext empsalary , bonus

    Imran

    commented on Oct 26 2013 2:48PM
    mimran18
    1622 · 0% · 12
  • Thats a good alternate mimran18. Thanks

    commented on Oct 29 2013 4:23AM
    Madhivanan
    2 · 40% · 12993

Your Comment


Sign Up or Login to post a comment.

"Scripting the definition of computed columns" rated 5 out of 5 by 3 readers
Scripting the definition of computed columns , 5.0 out of 5 based on 3 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]