aluminum_starch February 2016

Where is the SQL Server 2012 formula stored?

I am doing a report, and one of the tables called tblProduct has a calculation triggered in SQL Server that calculates cost on a column. I am having trouble locating the formula. Is there a way to determine what or where the formula is being pulled from ?

Answers


ArturoAP February 2016

If you are using Management Studio in the object explorer go to:

YourDB>YourTable>Triggers>YourTrigger


Kamran Farzami February 2016

By the sounds of it you are looking for a calculated column. So if you are looking for the logic within a calculated column you can get this by simply doing the folowing:

  1. Right click on the table
  2. Go to script table as
  3. Click on CREATE to.

Within the definition then you should see the calculated column definition

SO in the below example:

USE [KamTest]
GO

/****** Object:  Table [dbo].[temp]    Script Date: 2/8/2016 2:24:40 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[temp](
    [Col1] [int] NULL,
    [Col2] [int] NULL,
    [col3]  AS ([Col1]*[Col2])  --<-- the calculated column
) ON [PRIMARY]

GO

below is the calculated column definition

[col3]  AS ([Col1]*[Col2])


aluminum_starch February 2016

I figured it out , it maybe for someone in the future. It was in the server agent under Jobs and there were jobs that calculated another sp.

Post Status

Asked in February 2016
Viewed 3,749 times
Voted 9
Answered 3 times

Search




Leave an answer