<?
$sql="";

$sql.= "IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pf_paquete_historial]') AND type in (N'U'))\n";
$sql.= "BEGIN\n";
$sql.= "DROP TABLE [prefrio].[dbo].[pf_paquete_historial];\n";
$sql.= "END\n";

ejecutarsql($sql,$filas,$otro);
$sql="";

$sql.= "IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pf_paquete_historial]') AND type in (N'U'))\n";
$sql.= "BEGIN\n";
$sql.= "CREATE TABLE [pf_paquete_historial] (\n";
$sql.= "[id_paquete] int NOT NULL,\n";
$sql.= "[fecha] varchar(25) NULL,\n";
$sql.= "[id_camara] smallint NULL,\n";
$sql.= "[id_estado] int NULL)\n";
$sql.= "ON [PRIMARY];\n";
$sql.= "END;\n";

ejecutarsql($sql,$filas,$otro);
$sql="";
?>
