Questions tagged as 'sql-server'

2
answers

How to create a delete trigger in SQL Server2012?

I have a table called Productos in which I want to create a trigger which does not allow to delete a record when the existence of this product is greater than 0 I tried the following: go create trigger ProductoExistencia on...
asked by 01.12.2016 / 19:27
1
answer

Sum Sql Server with condition

I have the following query: select distinct GETDATE() as Fecha_Actual, f353_fecha_vcto, DATEDIFF(day, f353_fecha_vcto, GETDATE()) AS Dias_Vencidos, f353_consec_docto_cruce, f353_total_db, f353_total_cr, f353_total_db - f353_total_cr AS Valo...
asked by 04.09.2018 / 18:29
2
answers

Use BETWEEN in SQL Server

I need to show in the query the information that is not more than 120 days today so I think I could use BETWEEN but, I do not know how to use it in the correct way to know which day corresponds 120 days ago. SELECT NOMBRE, PUESTO, FECHA...
asked by 04.09.2018 / 23:40
3
answers

Using Contains in SQL server

Hello friends I want to make an insert, but I will only do it if one of the parameters that my SP is receiving, in this case the extension has the word "pdf" , then I'm trying to do this, but send me error: s Insert into ArchivosCont...
asked by 03.09.2018 / 23:03
1
answer

Error config file mssql

I'm trying to connect to my local database and these are the parameters I have: var config = { user: 'Eduard-PC\EdwarD', password: '', server: 'EDUARD-PC\SQLEXPRESS', database: 'nodejslogin' }; I get the following error:...
asked by 06.06.2017 / 02:47
1
answer

Create a query using a single table, in SQLServer

List the names of the employees and the name of their respective boss (only those who have a boss). [use joins] SELECT * TABLE employee What I want is, if supervisor is 3 then the name of Karolina appears, which is the...
asked by 04.11.2016 / 08:46
2
answers

Optimize a list of SQLServer in C #

I have to list about 900000 records from a database, and then do a tour in C # with a FOR, but being too many records I get the error of waiting time exhausted. Is there any way to accelerate this? This is my SP in SQL: The result is 870000 reco...
asked by 20.11.2018 / 19:50
2
answers

Replace the value of NULL with a fixed value in a Join SQL Server

I'm joining two tables in SQL using a LEFT OUTER JOIN. This is my query: SELECT V_InvoiceHeader.IDFactura, V_InvoiceHeader.FechaDocumento, V_InvoiceHeader.NombreCliente, V_InvoiceHeader.NIT, V_InvoiceHeader.DireccionFacturacion, V_In...
asked by 30.11.2018 / 18:36
1
answer

Insert ItemArray in SQL Server

I am trying to insert the record by the Excel registration to SQL, I have already loaded my excel, I go through it with a foreach in the following way: SqlConnection cnn = new SqlConnection(); cnn.ConnectionString = "Data Source=Localhost;Init...
asked by 28.12.2018 / 00:48
2
answers

ExecuteScalar returns ASP Null Id ASP.NET

I'm trying to create a comment system in a personal project and the following problem arose, when wanting to generate a new comment I do not recognize the Id of the comment and the ExecuteScalar returns me as null the Id, the idea...
asked by 19.12.2015 / 05:31