Questions tagged as 'sql-server'

1
answer

Assemble query for specific scenario

I have a table with the model below (consistent data): CODIGO | INICIO | FIM 1 | 2018 | NULL 1 | 2017 | 2017 1 | 2014 | 2016 I need to find the records where the INICIO has the same value as the previous FIM...
asked by 29.12.2018 / 17:27
2
answers

SQL Server foreign key is giving null value when entering data in main table

Good! I am learning sql about a week ago and I have some problems understanding how foreign keys work, specifically creating inserts in an application where the foreign key is receiving null value. (and each table id is receiving its respective...
asked by 01.12.2018 / 22:44
0
answers

How to Relate a Table with Another Table where the field to relate is an XML

I'm having a SQL Server database from a system that has been discontinued. In this database, there is a MOVIMENTACAO table and a EQUIPAMENTO table, where you would set a N:N relationship. The problem is that instead of ha...
asked by 27.11.2018 / 14:22
0
answers

Import Excel that does not have default to SQL SERVER with C # [closed]

I have the following scenario: I have an Excel spreadsheet that is provided by several private companies. This worksheet contains social security data. The problem is this: I have columns that refer to company data and columns that refer to the...
asked by 28.12.2018 / 12:10
1
answer

APP quits unexpectedly on your smartphone

Below is the code and logs. I try to run, but it always closes the app unexpectedly. It closes without showing the error image or inserts into the database. package... imports public class Cadastro extends AppCompatActivity { EditText t...
asked by 03.10.2018 / 22:16
2
answers

problems in insert in classic asp (replace)

People, in my database, the column is set to numeric (18,2) Then I have a field in a form that the person types the value and it goes to my table. insert looks like this: entrada = Replace(Request.form("entrada"),",",".")...
asked by 26.09.2018 / 17:29
0
answers

Variable is not filled in procedure

Good morning. I'm running the procedure below, which validates whether the load should run or not, and if it is not possible to run, it returns an error message stating why it did not run: declare @dtAtual date, @dtCarga date,...
asked by 27.09.2018 / 16:54
0
answers

How to integrate a Class Library into a Database Project in Visual Studio

Hello, I'm creating a solution in Visual Studio where I would like to separate all layers of the application into projects to have a more well-defined structuring. My solution so far looks like this: Solution | - Database (Database Project)...
asked by 11.09.2018 / 16:54
0
answers

How to validate the result of a Case

Validating the result of a Case I'm getting the interval between two dates in days, I want to validate if the result is greater than 120 days, is it a better way I'm doing? DECLARE @DataInicioVigencia datetime; -- ='2018-11-30T00:00:00'; D...
asked by 03.09.2018 / 23:25
1
answer

pass external parameters to sqlcmd via batch

I used it in oracle so I would like to know if you have any similar method for sqlserver (sqlcmd) . Batch sqlplus.exe system/123@localhost/xe @..\CRIA_TABELAS.sql "%last_bill%" .sql file SELECT * FROM TB_VENDAS_&1...
asked by 06.09.2018 / 14:18