Showing posts with label Archiving process through SSMS Sql jobs. Show all posts
Showing posts with label Archiving process through SSMS Sql jobs. Show all posts

Friday, May 24, 2013

[SQL Server Data Warehousing] Archiving process through SSMS Sql jobs


Hi,


you need to create a Sql server agent job and in Step , Type= Transact SQL( TSQL).


paste your query in Command pane.


Sample:



Create table #T( id int, name varchar(50),LoadDate Date)
go
insert into #T values (1,'TESTNAME',GETDATE()-100)
go

insert into #T values (2,'TESTNAME2',GETDATE()-101)
go

insert into #T values (3,'TESTNAME3',GETDATE()-150)
go

insert into #T values (4,'TESTNAME4',GETDATE()-1)
go

insert into #T values (5,'TESTNAME5',GETDATE()-10)

select * From #T

--Insert into your Report Database
--insert into Dbo.DestinationTable
Select * from #T
WHERE LoadDate <= DATEADD(mm, -3, GETDATE())

Once the Job is created , you need to create Schedule for that. you can run the job every day, monthly or after each 3 months. 


If you are looking for different answer, please explain your requirement with example.


Thank you


Aamir



http://sqlage.blogspot.com/




.

social.technet.microsoft.com/Forums

Saturday, May 18, 2013

[SQL Server Data Warehousing] Archiving process through SSMS Sql jobs

Dear team
i am loading the data(tables) from source(Oracle) to destionation(Sql server(2008))using SSIS packges.In Few tables having huge amount of data
(transcationaldata).so my destination Specified Duration(example month or 3 months wise)data move to another table on same or different database for My Reporting Pupose. whenever i need this data i will fire the query on this table. right now i am doing this process manually on every month.

I need to do the Archiving Process (using SQL Schduler jobs )

anybody know explain me way?


.

social.technet.microsoft.com/Forums

Search This Blog