<?
$sql="";

$sql.= "IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[pf_paquete]') AND type in (N'U'))\n";
$sql.= "BEGIN\n";
$sql.= "DROP TABLE [prefrio].[dbo].[pf_paquete];\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]') AND type in (N'U'))\n";
$sql.= "BEGIN\n";
$sql.= "CREATE TABLE [pf_paquete] (\n";
$sql.= "[id_paquete] int IDENTITY(1, 1) NOT NULL,\n";
$sql.= "[productor] varchar(100) NULL,\n";
$sql.= "[fecha_llegada] varchar(50) NULL,\n";
$sql.= "[fecha_salida] varchar(50) NULL,\n";
$sql.= "[id_especie] int NULL,\n";
$sql.= "[pallets] int NULL,\n";
$sql.= "[puchos] int NULL,\n";
$sql.= "[transportista_recepcion] varchar(50) NULL,\n";
$sql.= "[transportista_despacho] varchar(50) NULL,\n";
$sql.= "[patente_recepcion] varchar(15) NULL,\n";
$sql.= "[patente_despacho] varchar(15) NULL,\n";
$sql.= "[id_tipo_envio] int NULL,\n";
$sql.= "[id_pais] int NULL,\n";
$sql.= "[id_estado_actual] int NULL,\n";
$sql.= "[id_ubicacion_actual] int NULL)\n";
$sql.= "ON [PRIMARY];\n";
$sql.= "END;\n";

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

?>
