Questions tagged as 'sql-server'

1
answer

Viewing Query History in Sql Server Management Studio

I'm trying to retrieve queries I've made in Sql Server Management Studio 2014, I know there's a simple history feature in Heidi Sql, I'd like to know if Sql Server Management Studio 2014 has the same functionality.     
asked by 25.01.2016 / 17:11
2
answers

In a SQL query, to bring row values in a single row, in the field

I need to make a query that brings values of 2 rows into a single Ex: id | valor | banco 000001 | 1000,00 | caixa 000001 | 1000,00 | bradesco I need it to look like this: id | valor | banco 1 | banco 2 000001 | 1000,00...
asked by 02.08.2018 / 21:45
2
answers

Can a worse-cost query be a better-performing query?

Context Here in the company we have a very complex query that encompasses several business rules, for presentation in a WorkFlow and for now I am evaluating it in SQLServer . The performance of this query was poor and as the tables grew,...
asked by 25.09.2014 / 22:59
1
answer

Name of a Role with an accent in the Identity database

The need to create a Role with accent in the Roles table of Identity in the database: "Technical". Myquestioniswhetherthiscanleadtofurtherproblems,perhapswhencheckingforsomethinglikeUser.IsInRole("Técnico") or if the...
asked by 11.05.2018 / 14:57
4
answers

Day and month comparison in SQL Server

I need to filter all clients that have an anniversary date between two reported dates in a query. How can I make a comparison of dates disregarding the year registered in the client? The current query looks like this: Parameters reported:...
asked by 17.05.2018 / 19:00
1
answer

Problem in SQL selection

Because even if I filter to return only the fiat manufacturer, does it return other values? SELECT FABRICANTE, MODELO, VALOR_DIARIA FROM VEICULO WHERE VALOR_DIARIA = (SELECT MIN(VALOR_DIARIA) FROM VEICULO WHERE FABRICANTE = 'FIAT') Re...
asked by 07.04.2018 / 01:49
1
answer

Rollback SqlServer on writing two different tables

Premise: I'm using EntityFramework6 for data persistence in SQLServer. At some point I need to write data in two different tables, but the second table has dependency on the first example. try{ MetodoPersisteNaTabelaA(); MetodoP...
asked by 08.02.2018 / 12:36
1
answer

Bring the first row based on a date in SQL

Another challenge stopped in my hands. I need help with my query. What I need: I want to know who the people who had account postings on a given day, where I need to display the value and status of that day. So, I have two tables, one...
asked by 28.02.2018 / 19:46
1
answer

SQL Constraints fits as DML or as DDL?

DDL - Data definition language: is used to create and change tables (CREATE, ALTER, etc.), right? DML - Data manipulation language: is used for data manipulation of tables (INSERT, UPDATE, DELETE, SELECT). Do CONSTRAINTS fall into the DDL...
asked by 22.02.2018 / 17:08
1
answer

Convert Data SQLServer

I would like to convert 02/01/2018 to 2018-01-02 00:00:00.000 , what I found on the internet so far was: select CONVERT (datetime, '02/01/2018', 120) That returns me 2018-02-01 00:00:00.000 , a little different than I ne...
asked by 02.01.2018 / 18:35