Questions tagged as 'sql-server'

1
answer

SQL Server query error

I have the following SQL: INSERT INTO SISCli (CdInscricao,DsEntidade,DsApelido,InInscricao,InCadastro,DsEndereco,NrCEP,NrInscricaoEstadual,NrCGCCPF,NrTelefone,DtCadastro,CdEmpresa,DsEMail,DsUSuarioInc,InClassificacaoFiscal,DsBairro) SELECT...
asked by 28.07.2017 / 20:50
1
answer

Query - Bring 5 higher records

I have the query below, where I need to bring only the 2 largest columns that have the highest values. Today is coming out like this: Conciliacao Extrato Integração 150 140 80 That is, I wanted to bri...
asked by 02.08.2017 / 23:50
1
answer

Formula within a Field

In a field I have the value of a formula ( (B/2)+ C ), with the value B and C coming from other fields, how can I change the values of the letters by their actual values and calculate the formula? I only need one north of how to do th...
asked by 06.12.2017 / 14:41
2
answers

For / Foreach Sql Server For Each Different Data of a Column

I need to execute a SQL command to give an Update to a table, The intention of this update would be to update a column with a sequential number per company, Ex: I have a table Sale in this table I have the column CompanyId for each company I i...
asked by 30.12.2017 / 00:57
2
answers

How to get the first result of duplicate rows?

Situation : In a table there is a list of items with their invoiced invoice amounts. This table has a single field that varies according to the insertion of the data, being able to repeat all the other columns and does not have a PK ....
asked by 30.08.2016 / 20:48
1
answer

Excel file reading with more than 1 worksheet in the same file using C #

In this code I can read all data from the Plan1 worksheet that has the name "Data" from the ".xls" file, but if I have more worksheet in the same file, how can I read it? Coderead:staticList<Entidade>ObterDadosExcel(stringcaminhoArquivo...
asked by 28.08.2018 / 04:11
1
answer

How to add the BUILTIN \\ Administrators group in SQL Server to non-English operating systems?

During the installation of my application on a server, the following line is executed: using (var com = con.CreateCommand()) { com.CommandText = "CREATE LOGIN [BUILTIN\Administrators] FROM WINDOWS"; com.ExecuteNonQuery(); } This cod...
asked by 19.05.2016 / 15:03
1
answer

incremental vs differential backup in SQL Server

Whenever I need to configure the backup routine of a SQL Server database I confuse these two types of backup. So I'd like to know: What does each one do? Given that I do a full backup on Sunday, when I have to restore a database do I have...
asked by 15.03.2017 / 18:07
1
answer

Sql Server - View the structure of View

I ran the following commands on the Sql Server database: comando 1: SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'vendas' resultado 1: TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ---------------- ---------...
asked by 17.05.2017 / 17:06
2
answers

Export query result sql server to txt file on apache server automatically

I make the following query from my apache server on a SQL SERVER database: <?php // Dados do banco $dbhost = "192.168.0.100"; #Nome do host $db = "DATABASE"; #Nome do banco de dados $user = "root"; #N...
asked by 16.01.2017 / 15:42