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.
| Author |
Topic |
|
voidmain
Starting Member
6 Posts |
Posted - 2006-02-19 : 04:11:18
|
| how to create a procedure to take out certain data and drop into another table? I want to get the latest data depending on #datethankx, |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-02-19 : 05:41:54
|
| [code]create procedure your_spasbegin insert into anothertable(col1, col2, col3, col4) select cola, colb, colc, cold from certaintable where somedatecolumn = dateadd(day, -7, getdate()) -- 7 days from todayend[/code]----------------------------------'KH'Time is always against us |
 |
|
|
voidmain
Starting Member
6 Posts |
Posted - 2006-02-19 : 06:16:34
|
| thank you, khtan. |
 |
|
|
voidmain
Starting Member
6 Posts |
Posted - 2006-02-19 : 09:33:50
|
| Another question. How do i automate execution of stored procedures??? For eg, run everytime a DTS package runs/or at a particular interval ? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-02-19 : 09:38:06
|
| You can scheduled the stored procedure via Enterprise Manager - Management - SQL Server Agent - Jobs - New Jobs. Under the step tab page, specify TSQL and your stored procedure under command.----------------------------------'KH'Time is always against us |
 |
|
|
|
|
|
|
|