Questions tagged as 'sql-server'

1
answer

Debug Proc in database sql server 2014

I use Sql Server 2014. I am having problems in Stored procedure, because when running with certain filters, I get this error:    Message 512, Level 16, State 1, Procedure   SP_CMO_SEL_PORTARIA_INATIVOS, Line 485 Subquery returned more than 1...
asked by 26.04.2017 / 16:12
1
answer

Case SQLServer, how to proceed?

I'm trying to display a column that is set to 0 and 1 so that by 0 it shows 'Ok' and then 1 'NOK'. Here is my code that is not working, but by the query slq String query1 = "Select DATA,HORA,RCPERFIL,BPCS,N_ETIQUETA,EMV_MIN,EMV_MAX,TMV,"...
asked by 13.11.2017 / 14:41
2
answers

Import CSV and convert date in dd / mm / yyyy format to yyyy-mm-dd

I'm totally new to programming, both in Python and Sql, so I have some questions that may seem basic. I get a .CSV file that comes with lots of information not compatible with Sql so I always have to manually change and import using the followin...
asked by 19.05.2017 / 17:38
1
answer

Find a numeric group in the string

Hello, I'd like some help finding a group of 20 numbers within a string that has characters and symbols. Let's say my string has 165 characters, I want the numbers 127 to 147 that are my group " 00001138271467122784", but the string size on the...
asked by 18.05.2017 / 22:34
1
answer

Doubt in converting rows into columns Sql Server 2012

I've transformed rows into columns and need to improve this query by adding another column row: This is a query: --****************************EMPRESA****************************** if(Object_id('tempdb..#TBEmpresa') is not null) dr...
asked by 24.06.2017 / 20:18
1
answer

Maintenance routine for cleaning log tables (sysssislog and sysdtslog90)

I have a standard SQL Server 2014 database and during base monitoring, I realized that I have some SQL tables that are a bit large and have been researching about it. The tables are sysssislog and sysdtslog90 By documentation...
asked by 20.01.2017 / 23:41
1
answer

Error using Code First From Database

I'm trying to use the Entity Framework with a SQLServer database that I created out of Visual Studio. The problem is that when I add the ADO.NET Entity data model in the project to make the relation, it is failing to create one of the classes to...
asked by 15.10.2017 / 20:49
1
answer

Return only part of the SQL field in the search

I wanted to return only the values that are in brackets in the table field in the query. SELECT F2 FROM [dbo].[Vestcasa_Ranking_Produtos_Custo_] F2 Airtom..(635) paulo victo r.. (234) Antonio.. (459) SEARCH THIS 635 234 459     
asked by 06.10.2017 / 20:23
1
answer

Spending only one year on a sql server 2014 proc

I made a filter in a proc and I can not bring results. When running the proc it did not give any errors, but it does not bring any result and I do not know if it is correct. The colleague said that I do not need to pass any parameters, I do not...
asked by 17.04.2017 / 14:26
1
answer

How to make a select that brings the data registered in a given week?

I want to list all the data registered in a given week, can someone help me? I did something similar to the example below and it does not work. public List<View_Venda> Venda_Semanais() { List<View_Venda> lis = new List<Vi...
asked by 13.04.2017 / 11:33