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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -