Questions tagged as 'sql-server'

2
answers

EF6 Code First Relationship between entities

I am trying to create a Condominium Data Model in ASP.NET with SQL Server. I stumbled upon the creation of the proprietario(1) relation with fracao(many) . The error returned is:    The INSERT statement conflicted with the FOR...
asked by 31.01.2014 / 13:14
2
answers

How to make a user in SQL Server 2008 only view a VIEW?

I made a View to send to a client, but I can not pass the general login and password for it. That way I created a user ( cliente_view ) and I would like it to only view the created View (sales_view_view). How to do this process...
asked by 26.06.2017 / 13:29
2
answers

Using the PIVOT operator without aggregation

I have the FAULTS table with the following columns: CREATE TABLE [dbo].[FALTAS]( [Id] [int] IDENTITY(1,1) NOT NULL, [Matricula] [int] NOT NULL, [Dia] [date] NOT NULL, [Situacao] [varchar](50) NOT NULL, CONSTRAINT [PK_FALTAS] PRIMARY KEY CLUSTE...
asked by 21.06.2014 / 19:19
2
answers

SQL Grouping by name, date and quantity per month

I am not able to group this resulting per month (FIELD "PP.PAPELETA_DATA"). Type the amount (count (PD.PessoaId) as Total) separated per month! Could someone give me a help? Use SQL SERVER 2012. SELECT PE2.PessoaNome, count(PD.PessoaId) as To...
asked by 14.02.2015 / 23:54
3
answers

List calculated dates per month based on parameters

Based on two dates received per parameter, I am trying to list all the dates per month (one date per month) based on the start date and until the end date. These returned dates must check which day of the week of the start date and the number of...
asked by 30.03.2016 / 17:12
3
answers

SELECT in a RELATIONSHIP WITH SELF-RELATIONSHIP (Checking for Occurrences)

I'm having a hard time making an appointment. The situation is as follows, I need the bank to return all names of courses that have no prerequisites and are not prerequisites. The relationship is this: /* Create a table */ CREATE TABLE DISC...
asked by 25.11.2015 / 18:39
1
answer

Sending data from one table to another with the deleted command

I'm creating this trigger in SQL Server , but I'm not getting the id to send the data to another table and delete this table. CREATE TRIGGER MoveComprador ON comprador INSTEAD OF DELETE AS BEGIN SELECT * INTO bk_comprador FROM...
asked by 19.06.2015 / 06:31
1
answer

Query only Date in a DateTime field with LINQ

I'm generating a report in an app I'm developing, but with a little problem. When I send a query in a date range, I can not get anything because it is a DATETIME (I can not change to date only, because I need the time in some moments). So I'm ju...
asked by 09.10.2015 / 17:00
1
answer

Insert data into a table from a Java form (Netbeans + SQL Server)

I have a form created so that you can enter data on a client and from that form open a button with a button that has the data, so far I have been able to make the button connection. Now my question is how can I send the form data to the table .....
asked by 03.06.2015 / 16:29
2
answers

SQL Server - Doubt update and relationship between tables

I have two tables, one call coletor , and another call material , I have a proc called cadMat , which was to register material in the database and by cpf (parameter of proc) put as name of collector the materials that it...
asked by 21.05.2015 / 13:18