Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
create Procedure proc1 asINSERT INTO orders2 SELECT * FROM Orders WHERE datediff(dd,ORDERDATE,getdate())>60INSERT INTO orderdetail2 SELECT orderdetail.* FROM orderdetail INNER JOIN orders ON orders.ORDERKEY=orderdetail.ORDERKEYWHERE datediff(dd,orders.ORDERDATE,getdate())>60