Questions tagged as 'sql-server-2012'

2
answers

What are schemas? What are the advantages of using it?

In which situations is its use recommended?     
asked by 11.06.2014 / 22:09
2
answers

SQL - Restrict query data

Good morning, I have an app in WebForms that from two DropDownList gets data from a database in MS SQL Server 2012 . At first DropDownList it will display the name of several companies in the database with the fo...
asked by 15.04.2016 / 10:50
1
answer

Select fields from another table with multiple foreign keys

I have 4 tables: Lojas(nomeLoja, *IDloja*, morada, telefone, email) Bancos(nomeBanco, *IDbanco*, morada) PlanoContas(*conta*, descricao) Gestao(NIB, nConta, conta1, conta2, IDloja, IDbanco, *IDgestao*) conta1 and conta2 are...
asked by 13.05.2014 / 18:16
6
answers

Convert DATA dd / mm / yyyy hh: mm: ss to yyyy / mm / dd

I have a date in the following format 14/12/2015 00:00:00 and need to convert to 2015-12-14 how can I do this in SQL ?     
asked by 15.12.2015 / 14:04
3
answers

'NT AUTHORITY \ ANONYMOUS LOGON' failed in SQL Server 2012 on remote server

I have a cool running application on my local server. I made some changes to it and prepared to publish a test approval environment. Since we are migrating the local banks and servers to a new data center , I decided to test the new applic...
asked by 24.09.2014 / 20:50
2
answers

Show command executed when error occurs in SQL

Considering the following executed command BEGIN TRY -- Generate a divide-by-zero error. SELECT 1/0; END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity...
asked by 07.07.2016 / 19:22
2
answers

SQL Server: how to create range of values based on a column with monetary values

Hello, community! I need a SQL query with the values of a table field of SQL Server 2012 shown as frequency distribution. Let's say I have the field Sales (in R $), type float. The lowest sale recorded was R $ 0.01 and the highest of R...
asked by 30.11.2015 / 20:46
1
answer

When to use WITH (NOLOCK)?

Select * from MinhaTabela with (NOLOCK) I know colleagues who always insert the With (NOLOCK) clause in their selects and I know others who preach that NOLOCK is bad practice and should never be used. Some claim that with NOLOCK we hav...
asked by 20.05.2016 / 21:33
1
answer

Error saving field of type DateTime

I am setting up an example of Code First, but at the time of saving a field of type DateTime in the database I get the following error    Converting a datetime2 data type to a datetime data type   resulted in a value out of range. \ r \ nThe...
asked by 23.11.2016 / 19:58
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