Thursday, May 16, 2013

How to test computed column in MS SQL Server Management Studio


To test computed column, I would fire up SQL server management studio, in Object Exploere, drill down to your dev/test/prod database, then to Programmability, then Functions, then Scalar-valued Functions. Mine is:

Colleague18_test_db/Programmability/Functions/Scalar-valued Functions/

For example, to test out computed column C70_PER_TODAYS_DATE, which takes a PERSON.ID as an argument, here is the query I would use:

SELECT [colleague18_test_db].[dbo].[C70_PER_TODAYS_DATE] ('myIDNumber')

If you don't see your computed column in Scalar-valued Functions, I recommend recompiling/reinstalling the computed column again.

No comments:

Post a Comment