Questions tagged as 'sql-server'

0
answers

PK and FK Conflict in SQL Server Database

I am facing a Primary Key and Foreign Key conflict problem in SQL Server 2017 Express. I am using ASP.NET with Entity Framework Code First (Migrations). The problem is that when I add a new Client that is a Person does not add. The Entity Framew...
asked by 29.10.2018 / 00:36
1
answer

how do I get the id from the information to be passed to the textbox

I wanted the textbox with the information about that student to be filled in with the student's MR (primary key). CREATE TABLE ALUNO( RM_ALUNO INT NOT NULL, NM_ALUNO VARCHAR (40) NOT NULL, SERIE_ALUNO VARCHAR (30) NOT NULL, DTNASC_ALUNO DATE...
asked by 16.11.2018 / 18:54
1
answer

File import into SSIS with columns in different positions each day

I have the following situation: I import a Flat File from a * .CSV file into a table in the database. Using SSIS in Visual Studio. However, each day the file I receive has the order of the columns changed. Thus, the "e-mail" field, for example,...
asked by 15.10.2018 / 17:12
1
answer

Filter with SQL query from a combobox - c #

I am creating a stock program and would like the query of items to be filtered by a combobox, ie, when typing in the search field only the results regarding the parameter of the combobox appear. This is my SQL query code: DataTable tabela =...
asked by 12.10.2018 / 21:54
2
answers

Case in Sub Select SQL SERVER

Good afternoon, I'm having trouble making a case in a subquery. I need to bring an information called the order_id from the sf_vendas_boleto table, however when it comes NULL I need to bring the order_id from the sf_vendas_online table. Fo...
asked by 18.10.2018 / 20:18
1
answer

SQL Server 2017 - Retrieve column description / comment on table in database - Metadata

I am trying to generate a data dictionary from my database in SQL Server 2017, and would like to retrieve the description / comment from the 'Description' field contained in the column definitions of each table. I was inspired by a code I found...
asked by 05.10.2018 / 19:35
1
answer

SQL Server 2017 - SELECT with Duplicate Metadata

I made a select using metadata, but the result of my selection brought me something like a 'Cross Join'. Even using GROUP BY and DISTINCT returns with the duplicate values. I would like a help for the values to return correctly ... follows the s...
asked by 05.10.2018 / 21:14
0
answers

How to create a TRIGGER for an INSERT event without causing a lock on the SQLServer table

Hello, I'm doing the integration between 2 solutions, where I need to detect the change of a table, and based on the information that is sent I should manipulate another table. I do not have access to the 1st solution to make it change itself, b...
asked by 11.10.2018 / 15:05
1
answer

Error while executing Add-Migration Setup

When executing the Add-Migration Setup command to create the table in SQL Server in the PM the message below occurs even though I do the api project reference with the shared. The system even gets to process something, but soon gives this erro...
asked by 05.10.2018 / 15:42
1
answer

Error performing fetch by date greater than 1 year DATADIFF () and DATAADD () function

Hello, I need to make a select in a database where the databuffer is older than one year. However I need to use a clause and in my where and when I try to use the DATEDIFF () and DATEADD () function in this way it does not return anything. Is th...
asked by 26.09.2018 / 19:16