Questions tagged as 'sql-server'

2
answers

Update one column when another column of the same table is not null SQL Server

What happens is that I need to do something like: IF Tabla1.GrupoId3 IS NOT NULL UPDATE Tabla1 SET GrupoAnexado = 'x' WHERE MiCampo = 'Condiciones' ELSE UPDATE Tabla1 SET GrupoId3 = 'x' WHERE MiCampo = 'Condiciones' But it marks me the foll...
asked by 14.09.2017 / 17:35
1
answer

Join Date and Time with SQL server

Hi, I'm working with SQL 14, and I want to join two columns one is Date and the Other Time, I've tried several ways but none of them I'm concerned, I mean they work or join the columns but when I do a query I do not know The change is reflected....
asked by 20.08.2017 / 04:55
1
answer

How to make INNER JOIN between a table in SQL SERVER and a linked server?

Well I mean, I have a database in SQL SERVER called SIELAB and another database in PostgreSQL called reservations , I managed to make the connection correctly and I have already managed to execute a SELECT query from a stored procedure...
asked by 17.08.2017 / 02:20
1
answer

query between 5 Sql Server tables (some without direct relation)

I need to complete this query (sql server 2008): select EstadoCotizacion.var_eco_descripcion, id_cot, Usuario.var_usr_nombres, fec_cot_emision, fec_cot_aceptacion from COTIZACION inner join USUARIO on COTIZAC...
asked by 12.08.2017 / 22:07
1
answer

Improve code efficiency

Is there any way to improve this code? So you do not make more than one query? Comando = "Select * from TClientes, TContratosClubes, TAgentes where TContratosClubes.idcontrato = '" & idcontrato & "' and TContratosClubes.idCliente = T...
asked by 09.08.2017 / 15:56
0
answers

SSIS does not generate Excel working with a large number of records

I'm having a problem with an SSIS, which basically retrieves the data from a table and exports it to an Excel. The problem is that when I work with a limited number of records (1000 records) Excel generates me without problems, but when I remove...
asked by 09.08.2017 / 13:01
1
answer

Stored Procedure to concatenate a varchar and an incremental integer in fields with repeated data - SQLServer [duplicated]

I need to edit the name of a field (in case it already exists) of my table in my database in SQLServer 2014. • If the @pNameTarea parameter is NULL or empty, an automatic Name is created, this YYMMDD being created and if there is a Task with...
asked by 14.08.2017 / 12:48
1
answer

Group by date + Dynamic time

I have the following structure: name fecha valor b1 12/07/2017 19:45 200 b1 12/07/2017 19:50 220 b1 12/07/2017 19:55 221 ... b1 13/07/2017 00:59 425 It is a table where records are kept every 5 min...
asked by 17.08.2017 / 18:14
1
answer

Insert data from Visual Studio to SQL Server

How can I solve this problem when inserting data from Visual Studio.net into SQL? This is my code that I use: Imports System.Data.SqlClient Public Class Form1 Private Sub BtnInsertar_Click(sender As Object, e As EventArgs) Handles BtnInserta...
asked by 23.07.2017 / 22:43
0
answers

How to pass the item from a combobox to a table in sql server 2012

I am new to visual and I have a problem when passing a textbox to a table in sql server 2012, it does it correctly, but when sending the content that I select from a combobox, it does not load anything in the database. data, I am sending the dat...
asked by 03.08.2017 / 01:49