Questions tagged as 'sql-server'

1
answer

Which record is repeated more times SQL

Good afternoon I have three tables in sql I want to know which is the best-selling product EYE I do not need to have the stock as data create table Producto( id_prod int primary key, nombre varchar(15) Precio decimal(2,2) ) create table Vent...
asked by 06.01.2018 / 19:20
1
answer

how to generate a varchar sequence in sql server 2014?

I want to make this column ID that is a varchar field be generated automatically, when I insert the name, as if it were a sequence, help     
asked by 13.12.2017 / 19:12
1
answer

group table values DISTINCT

I have the following table: ENVIO ORDEN LOTE 00011 1 6666 00011 2 6666 00012 3 7777 00012 4 7777 00012 5 8888 00013 6 9999 I need to get from that table, the following: ENVIO CTDORDEN LOTE 00...
asked by 29.11.2017 / 19:41
1
answer

CASE judgments

How one more case is added to do the following: horasExtra= case when horasMes>PlanWorkHours then abs(PlanWorkHours-horasMes) horasFaltantes= case when horasMes<PlanWorkHours then abs(PlanWorkHours-horasMes) end In the c...
asked by 03.01.2018 / 21:09
1
answer

Example of project with create-react-app react-router-dom and expressjs

I have a project with create-react-app where I do all project routes with react-router-dom (since the examples with react-router are no longer updated). I need to use data from a DB in MSSQL and I am using superagent to fetch the data using url...
asked by 03.11.2017 / 22:47
1
answer

Can not truncate table 'Table' because it is being referenced by a FOREIGN KEY constraint

Hi, I am trying to truncate ( TRUNCATE ) a database, but I have the problem that some tables are related so when I try to throw the query, it says:    Can not truncate table 'Table' because it is being referenced by a FOREIGN KEY constr...
asked by 03.11.2017 / 17:34
1
answer

Error converting the data type varchar to datetime

My problem is I want to add three dates that are in datetime format in sql. these date variables are in an SP and when sending the information manually in sql server: exec spInsertaCargoCobranzaMV '00024','002',21554,1,0,500.00,'5-19-2017',...
asked by 15.11.2017 / 01:25
1
answer

Any way to insert records when the table has default and identity in SQL Server?

CREATE PROCEDURE USP_ADD_CLIENTE @PNIDTIPDOCUMENTO INT, @PSNUMDOCUMENTO VARCHAR(35), @PSNOMBRES VARCHAR(40), @PSAPEPAT VARCHAR(25), @PSAPEMAT VARCHAR(25), @PSCORREO VARCHAR(40), @PSTELEF VARCHAR(25), @PNESTADO INT, @PSUSUREG VARCHAR(40) AS IN...
asked by 06.11.2017 / 19:16
1
answer

DML triggers, the inserted, deleted and "updated" tables

I have been using DML triggers, the inserted and deleted tables. But I can not find the way to have the same functionality after updating a table. Is there any way to do it?     
asked by 20.09.2017 / 00:18
2
answers

There is already an object named ##Temporal Table in the database

I have the following stored procedure, which allows to generate a report in Excel. The fact is that when several users are generating the report, a series of errors appear indicating that there is already an object called ##rpttabla in th...
asked by 22.09.2017 / 01:09