Questions tagged as 'sql-server'

2
answers

Strange behavior in DB - Too many records

The problem is that this returns me 8 records while in the database they are only 2. That is 4 for each 1. I can not understand why. (If you want to edit the title of the question) I have this DB: AndIhavethisselect:selectalunos.numero,fa...
asked by 03.02.2016 / 09:49
1
answer

Order by with union

I have the following tables: Pessoa1 Id | Nome | Cidade 1 | José |São Paulo 2 | Maria |Rio de Janeiro Pessoa2 Id | Nome | Cidade 1 | Pedro |Belo Horizonte 2 | Ana |Vitória I have...
asked by 08.09.2015 / 14:02
2
answers

Creating table with ID column primary key with auto increment

I'm using SQL Server Management and I'm trying to create a table that has the ID field that must be auto increment. However, I can not use the IDENTITY property, but do everything in script , in the same hand. I wou...
asked by 13.03.2017 / 20:54
1
answer

Security and authorization using Roles

I am terminating my application by configuring the authorization and permission of the application users. My idea is to tinker with the layout so that the menus and submenus are only visible to those who have permission for it. According to what...
asked by 16.07.2014 / 16:34
1
answer

Error trying to insert SQL SERVER

I created a table in the DB with the following code CREATE TABLE documentosDefesa ( id_documentos_defesa int NOT NULL, id_reclamatoria int NOT NULL, funcao nvarchar(50) NULL ); And now when I try to do the following insertion,: INSERT INT...
asked by 10.02.2015 / 12:29
1
answer

SQL command in C #

Well, I'm doing a crud using mvc and the entity framework, but I do not know how to pass parameters ... here's my code public void Cadastrar(TimeModel timeObj) { strQuery = "INSERT INTO TimeFut (nome, estado) VALUES (aqui vai os parâmet...
asked by 17.12.2018 / 17:50
1
answer

Group By SQL Server Function [closed]

I'm new to SQL Server , I'd like some help to understand the Group By function in a simple way. Both its concept and how to use ... for anyone who can help me thank you right away!     
asked by 12.12.2018 / 18:54
1
answer

Distribute column values, SQL

I'm extracting data from a table with the following query: SELECT [nu-cpf] as CPF, [nome segurado] as NOME, '' as IdentificacaoCliente, '' as CodigoBeneficio, CONCAT([nu-ddd],[nu-telefone]) TelefoneResidencial, '' as TelefoneCelular,'' as Te...
asked by 10.08.2018 / 20:09
3
answers

How can I do "Inner Join"

    
asked by 29.06.2018 / 10:55
1
answer

SQL SERVER Filter

I have an exercise to do but I'm breaking my head here: "SQL command that brings me the sum of the salaries received by employee and state in the year 2014 of the tables: SALARIES / COLLABORATORS / LOCAL_DE_TRABALHO". I have already create...
asked by 02.07.2018 / 01:40