<?
$sql.="if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pf_sensorxcamara_alarma]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)\n";
$sql.="drop table [dbo].[pf_sensorxcamara_alarma]\n";

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

$sql.="if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pf_sensorxcamara_alarma]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)\n";
$sql.=" BEGIN\n";
$sql.= "CREATE TABLE [dbo].[pf_sensorxcamara_alarma](\n";
$sql.= "	[LecturaDirModulo] [smallint] NOT NULL,\n";
$sql.= "	[LecturaDirTipo] [smallint] NOT NULL,\n";
$sql.= "	[id_camara] [smallint] NOT NULL,\n";
$sql.= "	[lectura_valor] [smallint] NULL,\n";
$sql.= "PRIMARY KEY NONCLUSTERED \n";
$sql.= "(\n";
//$sql.= "	[LecturaDirModulo] DESC,\n";
//$sql.= "	[LecturaDirTipo] ASC,\n";
$sql.= "	[id_camara]  DESC\n";
$sql.= ") ON [PRIMARY]\n";
$sql.= ") ON [PRIMARY]\n";
$sql.="END\n";

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



?>