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 |
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2010-03-16 : 12:32:55
|
| HI I have a table that gets sent from Production to my server, refreshed every night. There is one field in one table, that I need it to have a value. Currently, it is always blank. I would like to know the best way to have this field updated daily. Can it be done at the database level ? I am not sure if this is someting for a trigger or a program to run each day? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-16 : 12:34:54
|
| what do you want it to be updated by?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-03-16 : 12:42:08
|
You want the field to be updated with what value ? a constant value ?When do you want the field to be updated ? When the table gets "refreshed" ? How is it get refreshed ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2010-03-16 : 14:16:57
|
| For now, a constant value, 'Department'. Later on in the year, they will start entering the department so then we can stop the auto trigger. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-17 : 01:20:43
|
| if its for inserts then a default constraint on column will suffice which can removed later once they pass actual dept value------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-03-17 : 05:36:31
|
| Sounds like the table gets kyboshed each night when the data is copied over, and you want to then change it to be "different" to the copied data?Scheduled task would be OK provided it ran after the copy finished and before anyone accessed the data - sounds "fragile" to me.I think it would be better that the process that copies the data over then executes some additional code that does any other "tidy up" tasks - like creating your "department" value. |
 |
|
|
|
|
|