Questions tagged as 'sql-server'

1
answer

Grouping data by period

I am doing a query in the bank, to return the product entry by hour (from 00:00 to 23:00) during a certain day; follows the query: SELECT CONVERT(VARCHAR(13),DATA_ENTRADA,120)+ ':00:00' AS HORA,COUNT(*) AS QTD FROM Tb_Produtos GROUP BY C...
asked by 30.03.2017 / 17:54
1
answer

Media Calculation between SQL Selects

Good afternoon. Please help me    Syntax error   Msg 102, Level 15, State 1, Line 2087   Incorrect syntax near 'TAB'. --TARIFAS --Calcular Média Tarifada BEGIN TRY DROP TABLE #TARIFASINDMETRO END TRY BEGIN CATCH END CATCH SELECT...
asked by 27.03.2017 / 21:56
0
answers

Query Return on Sql Server

I need to build a proc that performs two selects. The first one will return 1 or more information from one column (chassis number for example) and with this result I need to make another query reporting one chassis at a time. For example,...
asked by 27.03.2017 / 21:52
2
answers

Monitor the completed insert / delete / update SQL SERVER 2014

Does anyone know how to register the insert / delete / update held in the database outside the application or restricting per user? For example only via SQLMAnager only, The Bank is SQL Server 2014;     
asked by 07.04.2017 / 00:20
1
answer

Join select to total results

Howtototalthestoredquantityoftheseproductstobeabletocomparewiththetotalorderquantityforresale"QTD REQUEST". How can I do to find the total stored and join the result? Select: SELECT ipv.ProdCodEstr 'CÓDIGO DO PRODUTO',...
asked by 28.03.2017 / 15:43
1
answer

Select the line with the oldest date within that query between the repeated values

select e.nm_equipto as EQUIPAMENTOS ,Max(remessa.dt_uso_inicio) as DATA_REMESSA --,(SELECT MAX(DT_ENTORC_OFICINA) FROM ORCOS)as DATA_ABERTURA ,MIN(dt_entorc_oficina) as DATA_ABERTURA ,o.numero as NÚMERO ,patr.nr_patrimonio as P...
asked by 23.03.2017 / 18:13
0
answers

SQLSERVER authentication windows

I'm trying to connect to SQLSERVER 2012 with windows authentication and it shows me this error, I have two servers created, I tested both but it did not work, before when I used it it connected. 'TITLE: Connect to Server Can not connect to...
asked by 22.03.2017 / 12:48
1
answer

Conversion of SSIS data from varchar to int

I'm stuck on a SSIS conversion, scenario: I have a CSV file, which I need to import into a table already created in the database, In this database table I have an already populated column that receives data type INT, I noticed that there are...
asked by 07.03.2017 / 22:31
0
answers

Fill combobox with SQL Server Compact data

I need to populate a combobox with data from a SQL Server Compact column, the code I have has not worked. Class Servidor.cs : public DataTable Load(string sql) { Servidor objSqlCeServerDAL = Servidor.GetInstance(connString...
asked by 28.02.2017 / 12:40
1
answer

Receive parameter and depending on the value execute a specific procedure

I have a system in Classic Asp, and I need to execute a specific SQL Server procedure, according to a parameter that the system receives from a form. I tried to do this: if tipoagenda = 1 then ssql1 = "exec VerificaDataDisponivel" elseif...
asked by 21.02.2017 / 18:29