soozh
asked on
Transactions
Hello,
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?
/richard
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?
/richard
Did you try BULK INSERT? It's a faster way to insert data in tables.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.