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 |
|
Vack
Aged Yak Warrior
530 Posts |
Posted - 2011-02-14 : 10:50:34
|
| Can a SQL Job update a view?In my view I have a where inv_dt = 20100401. Can I have a job that updates the view to change the where statement to where = year(getdate())+04+01 |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2011-02-14 : 15:37:00
|
You don't need a job to change the view, simply make the Where clause use a calculation.WHERE inv_dt = <calculated date condition>How often does the date need to change, and what is the date supposed to change to so frequently you might need a job to change the view definition? Poor planning on your part does not constitute an emergency on my part. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-15 : 05:30:24
|
| If the date value is stored as an integer, you should usewhere inv_dt = year(getdate())*10000+04*100+01MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|