How to make a staging table in ms sql 2005?

Posted by chobo2 on Stack Overflow See other posts from Stack Overflow or by chobo2
Published on 2010-05-25T21:27:14Z Indexed on 2010/05/25 21:31 UTC
Read the original article Hit count: 119

Filed under:
|
|

Hi

I heard about doing staging tables and I am wondering how you actually do it.

I want to do a sqlbulk copy into a staging table. Then then update the real table.

I heard in mssql 2008 that you can use something called merge but I am using ms sql 2005 so I heard I have to use a update inner join?

I am not sure how that would look like(I am guessing best way would be to write it in SP). Also the staging table needs to be able to handle concurrent updates.

I was thinking of putting another column in the staged as GUID so that way I know which records belong to which group and when it is time to delete the records from the staged table I can just use that.

So can anyone show me any examples or tutorials on how to do it? Also how fast is this way? Say if your updating 50,000 records how long would that take(a guesstimate is fine)

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql-server