Questions tagged as 'sql'

2
answers

Is it possible to know where a sql execution originated from SQL SERVER?

There is a situation that I believe will be of great importance to me, which is to know the origin of a sql command in SQL SERVER. Suppose that a user accidentally ran any command. So I need to know who ran the command. Is there any way to...
asked by 16.02.2016 / 17:27
1
answer

How to delimit a txt file, that is, the line length should be 700 characters for all subsequent lines

I created a routine that reads some tables and generates rows as read. At first this is all right. but the txt generated exceeds the size of the fields, for example, one field has size 10 and another size 20 and another 15, the total would be 45...
asked by 14.01.2016 / 17:23
2
answers

Job created in SSIS does not work in SQL SERVER AGENT

I have a job created in SSIS (working perfectly) that does not work in SQL SERVER AGENT. The job extracts some data from an access table, via ODBC, and loads into a sql server local table. The Sql Server and the access database are on different...
asked by 14.01.2016 / 17:03
1
answer

Insert for foreign keys SQL

I'm learning a programming language and I set out to develop a budgeting program. My first hurdle is being to add the values of the primary keys in the foreign keys of the respective tables. This code below works well for this, but after copying...
asked by 15.11.2015 / 18:38
1
answer

SQL - Select all records with coding errors

Make a select in the database bringing all the records with coding errors: SELECT * FROM tabela WHERE titulo LIKE '%ÇÃ%' Does anyone know of a more efficient way?     
asked by 05.10.2015 / 17:47
1
answer

Get the parent passing the child code using Hierarchical Data (SQL Server)

How do I get EmployeeID of the parent passing the EmployeeID of the child from the table below using the hierarchyid variable in SQL Server? CREATE TABLE Employee ( Node hierarchyid PRIMARY KEY CLUSTERED,...
asked by 26.08.2015 / 22:21
1
answer

MySQL syntax error

Good morning, I have an error in my upload system. The error is as follows:    You have an error in your SQL syntax; check the manual that   correspond to your MySQL server version for the right syntax to use   near '', '845941', 'adventure',...
asked by 31.08.2015 / 13:46
2
answers

Firebird - Select with date less than 10 days

I searched but did not understand how to use the DATEDIFF () function in FIREBIRD What I need is for the query to return me records with dates up to 10 days prior to the current date . Note: Understand current date by the day the query...
asked by 31.08.2015 / 20:06
1
answer

How to return NULL in LEFT JOIN? [closed]

I have 2 tables that I need to manipulate: intervencaoprioridade: idintervencaoprioridade, idcelula ... cell: idcelula, name ... SELECT ip.idintervencaoprioridade, zc.nome nome_celula FROM intervencaoprioridade ip LEFT JOIN celula...
asked by 14.10.2015 / 19:07
1
answer

Show only one record of each ID

I have a table Clientes and a ClientesTel . I need to present a list where Código do Cliente, Nome, Telefone e o email appears, but by structure I can have several phones. Here's the SQL I'm trying to modify: SELECT Cliente...
asked by 05.09.2015 / 06:34