Questions tagged as 'sql'

0
answers

Delete records with related tables

I have 3 auto boards, AUTO TYPE AND I ASK what I'm trying to do is that when I delete a car type I get rid of the car related to that type of car and the requests made with this type of car are my tables CREATE TABLE [dbo].[Arriendo_Autos] (...
asked by 05.11.2018 / 19:25
2
answers

Fill a variable in PHP when a query is empty in MySQL

When doing a MySQL query in PHP the extracted does not throw anything at you so you assign a variable the extracted one does not take it as null or as zero even though you have created the variable as I do to assign a value to a variable in php...
asked by 04.11.2018 / 20:40
0
answers

Problem with PHPExcel format

I'm doing a query in Sql Server to bring some numbers and put them in an Excel file (.xls) with the library PHPExcel . $consulta = "selec celular FROM clientes where celular <> '' AND LEN(celular) = '10' AND ind_estado = '1...
asked by 02.11.2018 / 17:01
0
answers

Correct way to sort records

Good hope you can help me, I have two tables with the following information: (Client Table) clienteid nombre direccion telefono email --------- ------- --------- -------- -------- 001 gallo...
asked by 03.11.2018 / 00:02
0
answers

Automated Full Backup, what is it? SQL SERVER 2012

A udpate was made casually without where and when wanting to find a way to find a way back, I found this, is this a backup? I put task, restore, database     
asked by 09.11.2018 / 00:03
0
answers
0
answers

Before Update Trigger SQL SERVER 2012

alter TRIGGER AsignacionHorasDocente_TRG on tbdocentes after UPDATE as BEGIN DECLARE @nhoraCurso INT = (select sum(hor_curso) from tbcursos where id_categoria=1); DECLARE @nhoraDocente INT = (select sum(hdi_docente) from tbDocentes where id_c...
asked by 01.11.2018 / 08:32
0
answers

How to view queries and tables made in Visual Studio Express 2013

Hello in my programming classes we use SQL 2008 to practice and this shows the result when we execute a query line    SELECT * from table1 And this in turn shows in a window below the data that is in that table. But on my laptop I have th...
asked by 01.11.2018 / 01:31
1
answer

Update the value of a column of a BBDD

My problem is that I have to update the TOTAL_IMPORT field in the Customers table with the sum of the delivery notes (that match the client code, from the Customers table, that the user puts in) that are found in the Lines table. The client code...
asked by 31.10.2018 / 13:34
2
answers

I would like to use WITH before the query but I skip error

Well, I want to use WITH before the query but I miss an error, I attach the query of how I put the WITH and the error. DECLARE @cod_centro VARCHAR(2) DECLARE @fec_annomes int SET @cod_centro='MC' SET @fec_annomes='201810' WITH TH_Hospitaliz...
asked by 30.10.2018 / 16:45