Questions tagged as 'sql-server'

1
answer

SQL Server sum and distinct - Add once with repeated records

I have this table of expenses and I need to add the Total column. The problem is that the table takes into account the products, and when making the sum I added several times the total of a note (because in the same note there were seve...
asked by 24.04.2018 / 23:48
1
answer

How can I use a sql server view in asp.net core 2?

I did a view in sql server of several tables that I use very concurrent among them, my problem is that in asp.net core 2 I can only use the tables of my base with linq or EF from a context and their models that genre with Scaffold-DbContext, how...
asked by 22.04.2018 / 21:12
1
answer

Could someone please decide if the query syntax of these tables is correct?

CREATE PROCEDURE usp_ConsultarLibro @id_Libro char(3) as Select IdLibro, Titulo, NomApe_Autor, Nombre_Categoria, Nombre_Editorial, Nombre_Idioma, Año_Lanz FROM LIBRO L INNER JOIN AUTOR A ON L.IdAutor = A.IdAutor INNER...
asked by 29.05.2018 / 11:09
1
answer

how to do a join without duplicating records [closed]

Good afternoon, how could I get the following result from the image: in sql server since I have 3 tables of which 2 inherit from a main one, but when doing a join between these tables I double the value     
asked by 29.03.2018 / 18:12
1
answer

Tool to save script in sql as you develop to go into production

There is some tool to store the scripts of stores proc (not only stors, they can be functions, tables, trigers, etc.) what are you creating in development? So that in the end when you finish developing you can go to production. without the need...
asked by 27.03.2018 / 22:31
1
answer

Error entering user in java

I'm working on a project and now I need to create a view from the javafx side, which will be for new user registration but when I try to add it I get the error: "Exception in thread" JavaFX Application Thread "java.lang. RuntimeException: java.l...
asked by 19.05.2018 / 04:01
2
answers

What is the difference between making an INNER JOIN with ON and with Where? [duplicate]

I want to combine 2 tables with a INNER JOIN but I find 2 different syntaxes where they are placed like this:    INNER JOIN table_2 ON table_1_ID = table_2_ID and the other in this way, changing only where    INNER JOIN table_2...
asked by 18.04.2018 / 21:35
1
answer

How to use a variable in the Transact SQL update function within a trigger?

What I want to achieve is to go through each column of a table and check if it has a change with the function update (colum), but apparently it takes the variable where I keep the column as a valid argument. DECLARE @field INT , @maxfie...
asked by 20.03.2018 / 18:07
1
answer

Error in homestead with SQL Server driver when saving laravel session (DB-Library (as ISQL) or ODBC version 3.7)

I am saving my Session in the database using laravel with SQL Server in homestead (Ubuntu) and at the moment of entering the system it shows me this error:    SQLSTATE [HY000]: General error: 4004 Unicode data in a Unicode-only   collation or...
asked by 20.03.2018 / 17:37
1
answer

Do not insert duplicate data

I'm a bit confused, what would be the best practice to not insert duplicate data in a table, I have the following code. cnn = pyodbc.connect ( 'Driver={SQL Server};Server=**;Database=**;uid=**;pwd=**',autocommit=True ) sqlcmd = ("Select GEOM...
asked by 13.03.2018 / 13:20