Questions tagged as 'sql'

0
answers

InnoDB Error Code: 1215. Can not add foreign key constraint that I get on my client table can someone help me thanks

-- MySQL Script generated by MySQL Workbench -- Thu Nov 23 02:24:57 2017 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KE...
asked by 23.11.2017 / 07:56
0
answers

error code 1072. key column does not exist in table

CREATE TABLE 'prueba12'.'usuarios' ( 'ID_Usuario' INT NOT NULL AUTO_INCREMENT, ' USR_Nombre' VARCHAR(45) NOT NULL, 'USR_Apellido' VARCHAR(45) NOT NULL, ' USR_TipoUsuario' INT NULL, 'USR_Prestamo' INT NULL, 'USR_Libro' INT NULL, PRIMA...
asked by 19.11.2017 / 22:48
1
answer

Display a file from a SQL Server database in PHP

How about. I am working with php and SQL Server. I'm trying to extract the files saved in a field like image (it's the pdf of an invoice). The field contains a value like the following: 0x255044462D312E37200A25E2E3CFD3200A312030206F62...
asked by 20.11.2017 / 08:19
1
answer

mvc .net view does not work

When I go into the audiologe menu of my .net application I get the following error: Server error in the application '/'. The model element passed to the dictionary is of type 'System.Collections.Generic.List'1 [serviexpress.auditoria]', but t...
asked by 19.11.2017 / 00:18
1
answer

I can not create a foreign key in MariaDB

This is what I write: alter table T_reserva add constraint pk_codHotel foreign key (codHotel) references T_hotel(codHotel); This is the T_hotel.codHotel table: +----------------+--------------+------+-----+---------+------...
asked by 19.11.2017 / 02:24
1
answer

Help, insert records in related tables using php oo

Greetings friends, since yesterday I'm trying to solve an exercise but I can not find a solution for now. I have 2 tables in my DB called ts_client and another ts_quipment , the relationship is 1: n a client can have many computers. Previou...
asked by 18.11.2017 / 20:29
0
answers

As Together the "Names" and "Property in Your Charge"

SELECT E.NUMRUT_EMP ||'-'||E.DVRUT_EMP as RUT_EMPLEADO, E.NOMBRE_EMP ||' '|| E.APPATERNO_EMP as NOMBRE , COUNT(P.NRO_PROPIEDAD)"PROPIEDAD A SU CARGO" , CASE WHEN COUNT(P.NRO_PROPIEDAD) = 4 THEN count(P.NRO_PROPIEDAD)*(P.VALOR_ARRIENDO+P.VALOR...
asked by 18.11.2017 / 21:42
1
answer

help with query to update with fields separated by commas

I have the table COSAS CAMPOA CAMPOB Frutas Manzana Frutas Peras Frutas Uvas Lacteos Yogur CANTIDAD CAMPOC CAMPOD Frutas 1 Manzana 2 Peras 3 Yogur 1 Lacteos 1 I need a query that ponsiga this: FIELD A and FIELD C I...
asked by 15.11.2017 / 16:54
0
answers

Script to upload the Windows event log to a SQL DB

Good morning, Clarify first that the script works, but surely among all of you help me to optimize it. This is a script that extracts security events (Logon / Logoff from the machine) and stores them in a SQL database. Here goes: ' Set t...
asked by 17.11.2017 / 14:51
1
answer

Query to bring BETWEEN data

Good morning, folks, I'm going around with a query that would seem simple but I can not find it back. I am developing a reservation system in which fractional every 00:30 minutes and reserve by rank of 01:00:00 or 01:30:00 I have a reservation t...
asked by 28.11.2017 / 13:32