Oracle 8-8i e SQL Server 2000 a confronto
Tips & Tricks


   Come creare le statistiche...

In Oracle, si usa il comando ANALYZE nel seguente modo:

Statistiche esatte:

ANALYZE TABLE nome tabella
COMPUTE STATISTICS

Statistiche aprossimate:

ANALYZE TABLE nome tabella
ESTIMATE STATISTICS SAMPLE percentuale o numero di righe

In Microsoft SQL Server, invece, si usa il comando CREATE STATISTIS: modo:

Statistiche esatte:

CREATE STATISTICS nome statistica ON TABLE nome tabella WITH FULLSCAN

Statistiche aprossimate:

CREATE STATISTICS nome statistica ON TABLE nome tabella WITH SAMPLE percentuale o numero di righe


   Come salvare il risultato di una query...

In Oracle, si usa il comando spool nel seguente modo:

spool nome del file
query
spool off

In Microsoft SQL Server, invece, si usa il comando bcp: modo:

bcp "query" queryout nome del file -S nome server -U utente -P password