Questions tagged as 'sql-server'

1
answer

PDL sqlsrv is in phpinfo but does not work

I'm trying to access a SQL server from another Ubuntu 16.04 server using PHP, I made the entire drive installation process informed by Microsoft's own website and in phpinfo the installed drive is shown as shown in the images, however when I go...
asked by 24.03.2017 / 14:12
1
answer

Execute function that returns multiple values and based on these do the main SELECT - SQL Server

I have the following function in SQL Server that returns the name of each column of my table: CREATE FUNCTION dbo.FiltraNomeColunas(@FiltroColuna VARCHAR(200)) RETURNS VARCHAR AS BEGIN DECLARE @Retorno VARCHAR(200); SET @Retorno...
asked by 03.04.2017 / 15:16
2
answers

List of birthdays on a date range

It's giving me an error when I make this query to compare the anniversary day and month in sql format(data,'MM-dd') . I need to draw the date the month and the year and make a between Select NUMERO,DATA from utilizadores where format(DA...
asked by 19.02.2017 / 12:56
2
answers

How to add 2 columns?

I have 2 subselects , SQL , which bring 2 different information with the sum of the data. How to do to sum the 2 " sums " and bring in a new column, or a single column? CASE WHEN sd3.D3_UM = 'PC' THEN (SELECT ISNULL(sum(sd3_...
asked by 06.04.2017 / 12:55
1
answer

SQL Recovery Mode Database

Good afternoon, A database is in "In Recovery" status. When attempting to parse the error log through this dbcc checkdb command, it returns the following error message. Database is beeing recovered. Wait until recovery is finished. Does th...
asked by 27.01.2017 / 00:47
1
answer

INSERT in two Tables based on SELECT

Imagine the following scenario: At some point you need to duplicate people and their items. If I have the following data: Person Table +----+------------+ | Id | Nome | +----+------------+ | 1 | Joãozinho | | 2 | Mar...
asked by 02.03.2017 / 20:27
1
answer

Why this query does not work in Oracle?

I'm translating a SQL Server query to Oracle and found an error that does not make sense and I'm not getting it fixed. The error displayed is as follows: ORA-00904: "ITM"."NRO_INT_ITEM": identificador inválido 00904. 00000 - "%s: invalid i...
asked by 12.01.2017 / 12:35
1
answer

Doubt with sql query using time interval

I have a Job in the sql server that runs twice a day, 6:00 p.m. and 6:00 p.m., it has an sql query where I get the process date and compare it to the date of the day. It turns out that if you have a new change after 6:00 PM, they will not be upd...
asked by 27.12.2016 / 13:33
3
answers

Merge the result of a query on the same row from the sequence

I have the following query: SELECT * FROM SERQUENCIAL WHERE DATA BETWEEN '2017-01-01' AND '2017-01-19' It returns: +--------------+-------+------------+-----------------------+ | ID_PESS NOME | DATA | DATA_HORA | SEQUENCIAL...
asked by 19.01.2017 / 11:09
3
answers

Problem in field comparison with date and time

I have a query where I noticed that one of the fields used in the comparison brings date and time, compared to the current date of the day without time, this can cause problems in the return of the data: ex: select top(5) p.codinte...
asked by 26.12.2016 / 17:53