Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Run SQL Server 2005 query every night?

Author  Topic 

Mapper
Starting Member

12 Posts

Posted - 2008-09-15 : 12:29:08
I need to run a certain query every night on a database and am wondering what the best practice for doing so. I am pretty new to SQL Server, but am wondering if this would be best as a stored procedure, trigger or just what? Please help.

The basics of the query are as follows:

INSERT INTO Table 1 (value1, value2) SELECT value1, value2 FROM TABLE 2

http://www.BackcountrySecrets.com - Find and share places to play outdoors

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-15 : 12:30:37
You can schedule it as a SQL job. You don't need to put it into a stored procedure or a trigger. You can put the exact statement into the job.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Mapper
Starting Member

12 Posts

Posted - 2008-09-15 : 12:34:13
Where do you set up a SQL Job?

http://www.BackcountrySecrets.com - Find and share places to play outdoors
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-15 : 12:37:56
You can do it in SQL Server Management Studio in the SQL Server Agent section.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Mapper
Starting Member

12 Posts

Posted - 2008-09-15 : 12:49:05
I cannot seem to find the SQL Server agent in SQL Server 2005. Where is it?

http://www.BackcountrySecrets.com - Find and share places to play outdoors
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-15 : 12:52:22
What edition of SQL Server 2005 are you using?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Mapper
Starting Member

12 Posts

Posted - 2008-09-15 : 13:01:12
I'm using Standard. I found it though. I was trying to access it through management studio express and didn't see it, but I logged on to the actual server and it was there. Thanks for you help.

http://www.BackcountrySecrets.com - Find and share places to play outdoors
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-15 : 13:05:26
You should install the client tools from the Standard CD then as Express is missing features.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -