Questions tagged as 'sql-server'

1
answer

how to add values from different records?

I'm trying to add the value of id 1 and the value2 of id 2 which in this case would equal 220, how do I do this query ? ID VALOR VALOR2 ---------- ---------- ---------- 1 110 100 2 1...
asked by 08.04.2018 / 17:57
2
answers

How to run a subquery in LINQ C #?

How to run a subquery in LINQ C #? SELECT ap.ID FROM Aplicativo AP WHERE AP.Tipo IN (2,6) AND AP.ID NOT IN (SELECT filhoID FROM relacoesobjeto WHERE filhoclasse = 555)     
asked by 10.04.2018 / 19:11
2
answers

SQL Server - Change information in a text field (REPLACE does not work)

Helloeveryone.IhaveatablewithaTEXTfield.IneedtochangeaninformationwithinthistextfieldbutIcannotdoit.TheREPLACEfunctionworksinavarcharfield,butdoesnotworkwithinthetextfield.Forexample:Ihavearecordwherethisfieldcontainsthefollowinginformation:"IN...
asked by 09.01.2018 / 10:03
2
answers

Query SQL Server - Union

asked by 08.01.2018 / 14:27
1
answer

Doubt - SQL Server 2012 Query

Galera, in the query below to want to place a condition inside the where that only brings the tasks that they have with maturity two months after the opening date. For example. Task 11111 was opened on 11/01/2017 and has expiration on 01-01-2018...
asked by 21.12.2017 / 15:22
1
answer

Optimize module 10 SQL Server

I have a database created in approx. a decade, this same bank has several records and obviously, being in production, can not be changed from day to night. The problem is:    The products registered in the bank have serial, these serial at...
asked by 04.12.2017 / 19:18
2
answers

ISNULL in a Case When

I am doing a select using CASE WHEN in Sql Server, so it is done checking the existence of a record, if it exists, it makes select in a table, otherwise it makes select in another table, however, the two can return null. Something like th...
asked by 24.10.2017 / 21:21
2
answers

How to use Order Before before Union on sql Server using this query?

I have this query: SELECT * FROM ( SELECT distinct db_name() as 'Banco_de_Dados',g.KM_SIMBOL, fotos = COUNT(*) OVER (PARTITION BY d.globalid ORDER BY d.globalid),d.GDB_FROM_DATE as Data , g.RODOVIA , g.CODIGO FROM [dbo].GO_35...
asked by 12.09.2017 / 20:44
1
answer

Fill LineChart (Line Chart) wpf with data from a sql server query

Hello, I'm having trouble finding a solution to fill my linechart with data from a query, my connection class is complete and working, but I do not know how to apply it in the chart, I do not know how to create it automatically, I just insert val...
asked by 09.11.2017 / 18:36
1
answer

Insert the result of a Procedure into a new SQL table

I made the following code but I can not insert the result into the New Query table. Can anyone help me? Here is the Sql code: DECLARE @Resultado TABLE ( Tabelas nvarchar(max), data_sincronização date, rodovia nvarchar(max), elemento nvarch...
asked by 05.07.2017 / 19:56