Questions tagged as 'sql-server'

2
answers

Object Variable type and expressions

I would like to know if there is any way to mount an expression in ssis that returns true or false in a variable of type object: It would basically be something like in sql 12 in (14,25,45,12,54) but expression instead of a list would be some...
asked by 17.11.2014 / 16:42
3
answers

Difference between SQL SERVER dates

I have a question in sql server . Based on the table below, how can I take the difference in days which takes to go from one phase to another of the same client, ie phase to phase difference. Example: The difference between...
asked by 27.04.2018 / 22:48
1
answer

Query Return - Generic Repository Entity Framework

I have a generic repository and I realized that it is taking a long time to return a query with the selection of some columns of my database, the Query () method is as follows: public IList<T> Query(System.Linq.Expressions.Expression<...
asked by 26.04.2018 / 13:24
3
answers

SQL Query export to excel

Good, I have some difficulties in the result of a query. For you to fit it is as follows, I have a registration application of "unavailable." and I need the following: Every day I have to extract a report from the previous day, however thi...
asked by 16.09.2014 / 14:56
1
answer

I need help to turn this SQL into a LINQ

I have the following SQL: select conferencia.tb_conferencia.con_codigo, con_pedido, count(coi_codigo) as countItens, count(distinct cic_conferencia_item) as countItensConferidos from conferencia.tb_conferencia left...
asked by 23.08.2017 / 14:58
2
answers

how to specify values to sort sql server

Good afternoon! Well, I have the following query below, however, I want to sort by specifying some records. Attached for example, is the generated query and I want the Value column to look like this: Diamond Gold Bronze Silver How do you s...
asked by 12.07.2017 / 19:21
3
answers

Transform an Json Array into another JSON using node

Good morning, I'm having a problem mounting a JSON using NodeJS. I have a return from a giant SQL that basically follows the structure below. [ { "numDoc":"0000001", "OutrosCampos":"outrosDados", "itens":[ { "it...
asked by 10.07.2017 / 12:43
1
answer

Query between date range?

Table Ciclos : I have the date 2018-07-05 How can I put a query between the ranges of CiDtIni and CiDtFim according to the date above?     
asked by 12.07.2018 / 18:50
1
answer

How to create an index for two tables at the same time in SQL Server?

I'm pretty sure there's no way to do it, come on ... I have the following scenario: (include only key fields for brevity) - Tabela Venda: - id: int; - cliente_id: int; - cliente_tipo: char(1); - Tabela PessoaFisica: - id: int...
asked by 02.07.2018 / 19:18
1
answer

SELECT in VIEW generates subquery?

I would like to know if I make a VIEW with a simple query, if the call of the view generates a new SELECT, that is, a sub-SELECT totalizing 2 SELECTS or if it only points to the SELECT from within VIEW ? I only executed SELECT fr...
asked by 27.07.2017 / 20:07