Questions tagged as 'sql-server'

1
answer

Why do I enter a data in my BD when I enter a space at the beginning?

I have a problem with the maintenance of a system, when inserting a new data I put a space at the beginning when it is saved. Example: entering a
asked by 29.11.2018 / 01:50
1
answer

Decimal rank Sql server

Hello good day I want to know how I can make a condition I have this problem when in a query rest field1-field2 in the condition I must bring only when there are differences, however there is a difference sometimes I get 0.01 or -0.01 if that co...
asked by 29.11.2018 / 02:57
1
answer

FULL OUTER JOIN does not throw me NULLs where the key has no match (SQL Server)

I have two tables, as an example, TABLE1: Cuenta Fecha Valor 1 201801 a 1 201802 b 1 201803 c 1 201804 d 2 201801 f 2 201802 g 2 201803 h and TABLE2...
asked by 27.07.2018 / 18:27
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
2
answers

How to transform a column in Column Header in SQL?

What happens is that I need to transform a column into the head of the other columns, I do not know if I explain. Here something more detailed: I have this query which shows me the description column which I would like to be the header of...
asked by 21.06.2018 / 21:10
1
answer

Is it possible to use SCOPE_IDENTITY in an update? Alternatives?

Use SCOPE_IDENTITY to recover the id of the insertion and thus be able to work with it. Therefore I know that with insert it works. The question is, does it work with the update ? I have tried to follow a similar process a...
asked by 07.06.2018 / 10:05
1
answer

Erro in suds when consulting wsdl

I'm migrating some projects to python on sql 2017, and I ran into a problem about the suds library. EXEC sp_execute_external_script @language = N'Python', @script = N' from suds.client import Client url="https://graphical.weather.gov/xml/SOA...
asked by 27.05.2018 / 17:28
1
answer

Retrieve DateTime SLQserver in DGV VS

I have a problem when it comes to showing the time record, everything works perfectly, except when the date is 00:00 (right at midnight). Example of this case; 2018-07-26 00:00:00.000 The value recovers well in the program b...
asked by 24.07.2018 / 08:55
1
answer

Find dates closer to a given date

Good morning. I try to recover, based on a group of dates given by a user, the dates of a table that most closely match the dates given. The test data and tables are like this: create table PAC_ID_T ( IdPaciente int, NHC varchar (10)...
asked by 23.05.2018 / 19:18
1
answer

Data filtering between two SQL Server tables

Good afternoon, I have a problem wanting to select specific data when making a query to two tables; The tables are the following: create table persona ( id int identity (1,1) not null, nombre varchar (350) not null, apellido varchar (350) not...
asked by 22.05.2018 / 19:41