Questions tagged as 'sql'

1
answer

PostgreSQL nested query

I have a table used with the following structure: I want to get the head of each employee who is identified with the head column. I have the following nested query to get what I'm looking for, but it does not return the names of the...
asked by 06.02.2018 / 19:56
2
answers

Stored procedure to delete data in referenced tables

I need help with a stored procedure that allows me to delete a column in the usuarios table and when this column is deleted, delete all the data where it is used as primary key its id , the table that inherits from usuarios i...
asked by 07.02.2018 / 19:59
1
answer

Another way to save files without xp_cmdshell SqlServer 2008

Good morning classmates, I need your help, I have a storedprocedure where a select is executed and the information obtained from that query is printed and saved as a .txt file in a specific route by means of the command...
asked by 02.08.2018 / 18:55
1
answer

SQL insert more than one record in a table in an INSERT

I would like to make a query where I insert a record that is related to 2 more tables. MaximosyMinimos INSERT INTO MaximosYMinimos (ProductoID, SucursalID, Max, Min) VALUES ((select p.ID from Productos as p where p.ID = 1325 ), (select s...
asked by 19.02.2018 / 21:23
1
answer

Subquery in count SQL

I have the following table in SQL: ID Descripcion Respuesta 1 Nombre1 True 2 Nombre2 True 2 Nombre2 False 2 Nombre2 False 1 Nombre1 True And I want to get the following in one table: Descripcion T...
asked by 02.03.2018 / 18:04
1
answer

SQL - Master in same table with default value - Return the different values

I would like to know how (and if it can be done) in the same query, as long as the following SQL server query is efficient: I have a single table with the following fields: Id, CorporationId, Name, Value. In this table there are some "mast...
asked by 19.02.2018 / 23:02
1
answer

error: DataSource must be the identifier of a control of type IDataSource? ASP.NET C #

Hi, I have the following gridview in asp .Net <asp:GridView ID="grid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" CssClass="table table-bordered bs-table" allowpaging="True" ShowFooter="True" BackColor...
asked by 02.03.2018 / 19:03
2
answers

Separate strings in SQL

I have a problem and I hope you can help me. My problem is that I have to include in an SQL view (that I will later send in visual studio 2013) the fields "city" and "state" but in the source table the data comes in the same column and abbrev...
asked by 19.01.2018 / 16:52
2
answers

Join Various Results

Someone knows in sql server theme, how to join a result that gives me from 3 rows to a single row I'm using this query but it does not attach them to me in a single result, something when I do an XML result but with some function . SELECT ER...
asked by 17.01.2018 / 17:24
1
answer

How can I get rid of this UNION?

The truth is that for a long time, in a system that I have, there are three tables that are used to save settlements: At the request of the user, these tables must be duplicated in their final version and their temporal version, for which th...
asked by 09.03.2018 / 16:45