Procedure to delete and then insert data

1

Could someone guide me on how to construct a procedure to delete data from a table (already created with SELECT INTO), every day such an hour and then soon fill it again. Thanks in advance for your attention.

    
asked by anonymous 13.03.2016 / 17:16

1 answer

1

Marcilio first any doubt that has post your example so we can analyze.

Let's go

You can do this as follows

You can create a simple temporary table with # or global with #

Regardless of what you put in your select you will do it this way

Drop Table #Select_muito_grande
"Inserir as informações do seu select"
Into #Select_muito_grande
FROM "o restante das informações da sua consulta

NOTE: Do not forget to use WITH (NOLOCK) to optimize the process.

    
11.08.2016 / 17:52