SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 where to find the {script/stored procedure} in SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

raj vardhan43
Starting Member

USA
20 Posts

Posted - 12/10/2012 :  18:04:36  Show Profile  Reply with Quote
Hi Friends,

I need your suggestion.

We have a SQL SERVER 2008R2 dataware house. In this we have a table "DimTime". This DimTime table contains only data/records until 2013. NOW, we have to populate 2014 data/records also into DimTime table.

My manager told me to find/search the StoredProcedure/script inside the prod SQL SERVER 2008R2 dataware house which they used earlier to populate data into DimTime.
I had checked all the stored procedures/scripts but i couldn't find it.

Question: Is it possible to populate DimTime other than storedprocs/scripts ??

Am I doing this correctly ??

Thanks for your time

raj

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/10/2012 :  19:30:03  Show Profile  Reply with Quote
Use this query to find the stored procedures that contain the word DimeTime.
SELECT * FROM sys.objects WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%DimTime%'
If you don't find what you are looking for, it is possible that someone just ran a script to populate the table. If you post table schema along with a sample of the data you are trying to generate, people on the forum would be able to suggest how to do it.
Go to Top of Page

raj vardhan43
Starting Member

USA
20 Posts

Posted - 12/10/2012 :  20:21:22  Show Profile  Reply with Quote
Thank you so much

raj
Go to Top of Page

raj vardhan43
Starting Member

USA
20 Posts

Posted - 12/18/2012 :  17:45:35  Show Profile  Reply with Quote
hi sunita,

below is the defintion for our DimTime table


CREATE TABLE [dbo].[DimTime](
[PK_Date] [datetime] NOT NULL,
[Date_Name] [nvarchar](50) NULL,
[Year] [datetime] NULL,
[Year_Name] [nvarchar](50) NULL,
[Half_Year] [datetime] NULL,
[Half_Year_Name] [nvarchar](50) NULL,
[Quarter] [datetime] NULL,
[Quarter_Name] [nvarchar](50) NULL,
[Month] [datetime] NULL,
[Month_Name] [nvarchar](50) NULL,
[Week] [datetime] NULL,
[Week_Name] [nvarchar](50) NULL,
[Day_Of_Year] [int] NULL,
[Day_Of_Year_Name] [nvarchar](50) NULL,
[Day_Of_Half_Year] [int] NULL,
[Day_Of_Half_Year_Name] [nvarchar](50) NULL,
[Day_Of_Quarter] [int] NULL,
[Day_Of_Quarter_Name] [nvarchar](50) NULL,
[Day_Of_Month] [int] NULL,
[Day_Of_Month_Name] [nvarchar](50) NULL,
[Day_Of_Week] [int] NULL,
[Day_Of_Week_Name] [nvarchar](50) NULL,
[Week_Of_Year] [int] NULL,
[Week_Of_Year_Name] [nvarchar](50) NULL,
[Month_Of_Year] [int] NULL,
[Month_Of_Year_Name] [nvarchar](50) NULL,
[Month_Of_Half_Year] [int] NULL,
[Month_Of_Half_Year_Name] [nvarchar](50) NULL,
[Month_Of_Quarter] [int] NULL,
[Month_Of_Quarter_Name] [nvarchar](50) NULL,
[Quarter_Of_Year] [int] NULL,
[Quarter_Of_Year_Name] [nvarchar](50) NULL,
[Quarter_Of_Half_Year] [int] NULL,
[Quarter_Of_Half_Year_Name] [nvarchar](50) NULL,
[Half_Year_Of_Year] [int] NULL,
[Half_Year_Of_Year_Name] [nvarchar](50) NULL,
[GL_YEAR] [varchar](50) NULL,
[GL_PERIOD] [varchar](50) NULL,
[GL_MONTH] [varchar](50) NULL,
[GL_QUARTER] [varchar](50) NULL,
CONSTRAINT [PK_Time1] PRIMARY KEY CLUSTERED
(
[PK_Date] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]


Below is the sample data
2007-01-01 00:00:00.000 ,Monday , January 01 2007 ,2007-01-01 00:00:00.000 ,Calendar 2007 ,2007-01-01 00:00:00.000 ,Semester 1 , 2007 ,2007-01-01 00:00:00.000 ,Quarter 1 , 2007 ,2007-01-01 00:00:00.000 ,January 2007 ,2007-01-01 00:00:00.000 ,Week 1 , 2007 ,1 ,Day 1 ,1 ,Day 1 ,1 ,Day 1 ,1 ,Day 1 ,2 ,Day 2 ,1 ,Week 1 ,1 ,Month 1 ,1 ,Month 1 ,1 ,Month 1 ,1 ,Quarter 1 ,1 ,Quarter 1 ,1 ,Semester 1 ,2007 ,JAN-07 ,JAN ,Q1


Please suggest me any idea to extend the DimTime table range.




quote:
Originally posted by sunitabeck

Use this query to find the stored procedures that contain the word DimeTime.
SELECT * FROM sys.objects WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%DimTime%'
If you don't find what you are looking for, it is possible that someone just ran a script to populate the table. If you post table schema along with a sample of the data you are trying to generate, people on the forum would be able to suggest how to do it.



raj

Edited by - raj vardhan43 on 12/18/2012 17:48:56
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000