Quiero depurar una tabla grande en mi sqlserver 2000 con sp3.
El scripts es el sgte:
use navy
go
declare @w_fecha as datetime
select @w_fecha = dateadd(m,-3,getdate())
set rowcount 10000
while (select count(*) from navy..nv_trama where w_fecha < @w_fecha)> 0
begin
delete navy..nv_trama
where w_fecha < @w_fecha
end
dump tran navy with no_log
La estructura de mi tabla es:
Name Owner Type Created_datetime
nv_trama dbo user table 2003-09-06 08:24:59.153
Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation
w_fecha datetime no 8 no (n/a) (n/a)
w_oper char no 1 no no no SQL_Latin1_General_CP1_CI_AS
w_trama varchar no 2048 yes no no SQL_Latin1_General_CP1_CI_AS
Identity Seed Increment Not For Replication
No identity column defined.
RowGuidCol
No rowguidcol column defined.
Data_located_on_filegroup
PRIMARY
index_name index_description index_keys
IX_nv_trama clustered located on PRIMARY w_fecha
No constraints have been defined for this object.
No foreign keys reference this table.
No views with schema binding reference this table.
Y la tabla tiene 220.000
Leer las respuestas