Stored Procedure

Hello
New to stored procedures.
How can i careate a stored procedure in SQL Server 2000 that will


1. Run every 3 hours automatically and
2. Take data from one table and dump it in other table
Example
TableOriginal ( empID,empName,empExt)
TableUpdated ( empID,empName,empExt)
Every hour the stored procedure should
a) Delete all the records in tableUpdated
b) fill tableUpdated will data from tableOriginal.
Thanks
svariaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Duane LawrenceCommented:

Create proc xxxxxx
as
  insert into table2name (col1,col2,col3)
  select co1,col2,col3 from table1
  --where conditions here
go


Then in enterprise manager you want to schedule a JOB to run stored proc xxxxxx.  This is pretty easy as you just have to point and click.

Duane
0
wael_tahonCommented:
Use this code:

Create procedure  DumpTables
as

-- Delete Dump data
Delete from DumpTable

-- Insert new Dump Data
insert into DumpTable(col1,col2,col3)
     Select co1,col2,col3 from SourceTable Where Condition=1

Go

then expand the management in the entrprise masnager and create a job to run this Procedure every 1 hour
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gurpreet006Commented:
i have a table testt1 with three columns.i want to create a stored procedure which will insert data in this table every one hour
can i have the complete source code for the stored procedure.(completely new to stored procedure)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.