Questions tagged as 'sql-server'

1
answer

SQL Server "TRIM" Command

I'm working with Sql Server , and I need to trim in a result of a query. I did as follows: select TRIM(NUMERO) from ENDERECO In% w / w the command is "recognized", it is in the coloration of a valid command, but returned the...
asked by 03.01.2019 / 13:53
2
answers

Problem connecting to SQL Server 2012 database in IIS

I can not run queries from my system in IIS, when I run in Visual Studio I get the result quietly. The error I get when trying to do something is as follows:    System.Data.Entity.Core.ProviderIncompatibleException: An error   occurred whi...
asked by 22.03.2014 / 03:06
1
answer

Regex within SQL Server

How to recover fields with the following pattern? a111/1111 or a111_1111 or a111-1111 or a111+1111 where: a = some letter of the alphabet; 1 = any digit of 1-9; I mounted a Regex that is working...
asked by 07.12.2017 / 15:21
1
answer

SSIS loading entire XML before starting write to SQL Server

I need to load a single large (40GB +) XML file into a SQL Server 2012 table using SSIS. I'm having problems because SSIS seems to be trying to load the entire XML file into memory before loading records into the database, instead of reading and...
asked by 13.12.2013 / 02:51
2
answers

Delete record with duplicate (Id) leaving only one occurrence

This is an old bank, dbase that has been transferred to MSSQL . Home How to leave only one occurrence in the case of id duplicated in a table? | Id| Nome | |-----------| | 1 | JOSE | | 1 | JOSE | | 2 | MARIA | | 2 | MARI...
asked by 03.12.2015 / 15:36
1
answer

Rounding as a result of multiplication

I have this scenario:  - do a multiplication of 2 values that will be rounded to 2 boxes for the table that will be inserted its result. Follow the example: CREATE TABLE #TMP ( A DECIMAL(23,6), B DECIMAL(28,2) ) INSERT INTO #TMP VAL...
asked by 05.01.2016 / 20:58
2
answers

How to create a non-repeating sequential number per user

Work on a bill invoice project, in this project there is the Emissor entity. My database Sql-Server may have multiple emitters. Each issuer can issue its invoices. Each invoice must have a unique, sequential number. This seque...
asked by 14.03.2018 / 19:16
1
answer

Search for people with similar names

I'm developing a code to search for people's names intelligently using the SQL SERVER LIKE operator. In names like Souza and Sousa, use brackets [] Ex.: select * from pessoas where nome like 'joão sou[sz]a%'; The above example returns me...
asked by 14.03.2018 / 16:11
1
answer

In which cases they return the error Exception of type System.OutOfMemoryException

What are the most frequent cases that can return this exception ?     
asked by 18.09.2017 / 14:35
1
answer

How to optimize this query query with other subqueries?

I have a query query that is taking too long to execute (almost 2min) and needs to be optimized: select Cidade.Id as CidadeId, Cidade.Nome as CidadeNome, Cargo.Descricao as CargoDescricao, '{0}' as Grupo, Count(*) as Qtd from Funcion...
asked by 10.09.2014 / 15:58