Questions tagged as 'tsql'

3
answers

Error using count in a subquery

I have a query where I use 1 subquery to get data from several tables. And as a result, it returns a total of 2947 records. --CONSULTA INICIAL SELECT dniEgre, (SELECT TOP 1 CASE WHEN numeRespu = 1 THEN 'SI' ELSE 'NO' END FROM OCL.tblDet...
asked by 10.02.2017 / 05:24
1
answer

Select to records that do not contain value in table [closed]

I have the following table Pedimento | Partida | Identificador | Valor Agregado 6000001 | 1 | TL | 10 6000001 | 1 | PT | 10 6000002 | 1 | TL | 0 6000002 | 2 | XP | 0 6000003 | 3 | PT | 10 6000003 | 4 | TL | 10 How can I perform a query that...
asked by 11.02.2017 / 06:54
1
answer

Incorrect syntax CASE TSQL in SQL server 2014

My problem is this: I have to make a script in TSQL that if the numbers are less than 50, you must make the root of the sum of its squares, if it is equal to 50, add its squares, and if it is greater than 50, divide the first one between...
asked by 11.01.2017 / 22:30
1
answer

Priority to Order by instead of Where

Good morning to all, this question has the purpose of finding how I can generate an indicator of existence when the record is repeated: because the application has been previously generated, then I show the related query: SELECT id AS Existe F...
asked by 26.04.2018 / 18:56
1
answer

Different encryption in SQL

I have a table (Users) with 2 rows nameUser como varchar(50) passUser como varbinary(200) The question is that I am entering test data for later processing but I have noticed that entering the same password gives different encryption, for e...
asked by 15.08.2018 / 22:46
1
answer

I have problems with INNER JOIN SQL SERVER

I'm new in what data base refers .. and I'm working with the issue of INNER JOIN and the truth is that I'm not very clear about how it works and how to apply .. since I have an exercise and I can not join a third table that is related .....
asked by 10.12.2018 / 21:08
1
answer

How to make a backup of the database from terminal?

I have a database in MS SQL Server 2017 express, in ubuntu 16.04, I am administering it DBeaver and I do not set an option to make a backup, I have tried with terminal and it does not work: $ tsql -S localhost -U SA BACKUP DATABASE prolo TO D...
asked by 10.03.2018 / 06:42
2
answers

Operator LIKE does not work in my app vb.net

Greetings to all. I have the following problem I have a procedure stored in SQL Server that retrieves data with the like operator, but it does not work for me. create procedure recupera_art @cadena char(40) select * from articulo where clave...
asked by 16.01.2018 / 22:08
1
answer

set variable Query dynamic

Set variable within a dynamic query and for each database obtain the user result with the role 'db_owner' and represent them in '1' if you find results and '0' if you do not find. BEGIN DECLARE @baseDeDatos VARCHAR(50)...
asked by 04.07.2018 / 16:55
1
answer

Differences between FETCH ABSOLUTE and FETCH RELATIVE

I am working with cursors whose behavioral parameter is SCROLL but I do not understand what is the objective of two of its functions when it comes to making the FETCH . I do not understand what they do or what they serve FETCH AB...
asked by 14.06.2018 / 12:47