Questions tagged as 'sql'

1
answer

Problem calling procedure stored from Java

I have a problem trying to access a specific procedure stored in SQL Server from Java . The stored procedure receives a XML as a parameter, and returns another. An example of a call is the following: DECLARE @xml AS NVARCHAR(2000) DECLARE...
asked by 04.10.2018 / 11:45
1
answer

Error with SQL server Compound keys

this is the script for the first table CREATE TABLE [dbo].[eva_cat_metodologias] ( [IdMetodologia] SMALLINT IDENTITY (1, 1) NOT NULL PRIMARY KEY, [DesMetodologia] VARCHAR (200) NULL, [Clave] VARCHAR (50) NU...
asked by 03.06.2018 / 04:28
1
answer

Error Column name does not exist in SQL Server

I'm doing a query whose purpose is to put a label called Match and then filter that Match with WHERE , but it generates an error "Column name does not exist". My script is as follows: SELECT [Contra], [Schedule], SUM(CA...
asked by 24.05.2018 / 17:27
1
answer

Group 2 count () in a query in PostgreSQL

These are the tables in my database: animal _________________ |id_animal | zona | |__________|______| | T1 | 01 | |__________|______| | B1 | 01 | |__________|______| | C1 | 01 | |__________|______| | C2 | 01...
asked by 19.04.2018 / 01:33
2
answers

Linq adds a nonexistent column to the SQL query

I'm having a problem with LINQ, using EntityFramework 6 First, to enter the context, I leave the Problem Model .. [Table("Datos_Garantizados")] public partial class Datos_Garantizados { [Key] public long Version { get; set; } public decima...
asked by 28.03.2018 / 16:18
1
answer

Generate .TXT file with Stored Procedure

I have the following SP and I want the results saved in a .TXT file for   I also have a JOB which executes the Stored Procedure, which I configured   from the SQL Server Management Studio. This is an example of how a result of a query is sent...
asked by 09.01.2018 / 21:39
1
answer

Query to count different (MSSQL Server 2005 Express)

I have the following table: I need a number of different offices in each department: I made the following query, but it is not what the statement asks: SELECT depto_no, count(*) FROM empleado GROUP BY depto_no The issue is that...
asked by 20.11.2017 / 15:12
1
answer

Error trying to make a "DROP TABLE": "ORA-02449: unique / primary keys in table referenced by foreign keys"

I happen to be trying to delete the following table of name CITY with the following code: DROP TABLE CIUDAD; But when I run the code I get the following error: ORA-02449: unique/primary keys in table referenced by foreign keys 02449. 0000...
asked by 13.12.2017 / 23:35
1
answer

Database (My SQL), SQL commands

Basically, through which command, I could calculate the party that gets the most votes, I know that we have to use the Count and MAX command, but when using it at the same time it gives me an error. I leave the command you make and I get an erro...
asked by 24.11.2017 / 21:57
2
answers

show queries by careers

the idea is to show the consultations by career in the following image: the first 4 records on the right are of the second race and the last 4 of the first race and it is wrong, for example the query on the left shows me that it is the Second...
asked by 24.01.2018 / 21:59