sql server - Simple insert query in stored procedure -
i've manipulated data format need using view, , have simple insert query write data table:
insert mytable select * myview (myview.[date] > (select max([date]) mytable)) , (myview.[date] < getdate())
i'd run automatically on daily basis. bit new this, understanding need utilize stored procedure. not sure how execute code in stored procedure, though. when create new stored procedure, i'm given template:
create procedure [dbo].[update] @param1 int = 0, @param2 int select @param1, @param2 return 0
could me understand how bridge query stored procedure?
run , create stored procedure in sql server called the_name_of_your_sproc.
create procedure [dbo].[the_name_of_your_sproc] insert mytable select * myview (myview.[date] > (select max([date]) mytable)) , (myview.[date] < getdate())
Comments
Post a Comment