I have table that contains data that is updated daily. Each night a job runs that truncates the table and then inserts a new set of values.
The insert statement takes a few hours to execute.
At the moment the table is empty for those few hours. Other applications that run during the day select data from the table - so its important that everything is completed during the night.
I was wondering what would be the effect of putting everything in a transaction. Would the table appear to contain data all the time, or would it be empty during the period the transaction was commited?
Is this a good idea?
A second thought would be to use merge. Would the table always appear to contain data. Is this a good idea?