Most voted "sql-server-2012" questions
Related Tag 2012 version of Microsoft SQL Server, which is a DBMS - relational database manager system developed by Microsoft.
Learn more…87 questions
Sort by count of
-
17
votes2
answers28085
viewsWhat are schemas? What are the advantages of using it?
In which situations your use is recommended?
-
11
votes2
answers14208
viewsWhen to use WITH (NOLOCK)?
Select * from MinhaTabela with (NOLOCK) I know colleagues who always insert the clause With (NOLOCK) in their selects and I know others who preach that NOLOCK is bad practice and should never be…
-
9
votes6
answers49720
viewsConvert 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 as I can do it on SQL?
-
9
votes3
answers189
viewsSQL - Restrict query data
Good morning, I have an app in WebForms than from two DropDownList obtain data from a database in MS SQL Server 2012. At first DropDownList it will present the name of several companies in the…
-
8
votes1
answer4798
viewsSelect 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,…
-
6
votes3
answers1158
views'NT ANONYMOUS LOGON AUTHORITY' failure in SQL Server 2012 on remote server
I have a legal application running on my local server. I made some changes to it and prepared to publish an approval environment for testing. How we are migrating local banks and servers to a new…
-
6
votes2
answers323
viewsShow command executed when SQL error occurs
Considering the following command executed BEGIN TRY -- Generate a divide-by-zero error. SELECT 1/0; END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity…
-
4
votes3
answers12716
viewsSQL Grouping by name, date and quantity by month
I am not able to group this result per month ("PP.PAPELETA_DATA" field). Type the quantity (Count(PD.Personal) as Total) separated by month! Could someone give me a hand? Usage SQL SERVER 2012.…
-
4
votes3
answers3464
viewsAverage between 3 direct dates in sqlserver bank?
What is the most efficient way to calculate the average of dates in the same column by the sqlserver database? I need to take the date of the last 3 sales of a customer, and return in days to know…
sql-server sql-server-2012 sql-server-2008 sql-server-2014 sql-server-2005asked 9 years, 3 months ago Laísa Ferreira Cardoso 116 -
4
votes1
answer618
viewsSQL 2012 - replace (nolock) with(nolock)
I need help solving a mismatch problem. The company I work with is migrating from an SQL Server 2008 database to 2012, but we have identified some problems. The main one is the declaration of…
-
4
votes2
answers1652
viewsSQL Server: how to create range of values based on a column with monetary values
Hello, community! I need an SQL query with the values of a SQL Server 2012 table field shown as frequency distribution. Let’s say I have, today, the field Sales (in R$), type float. The lowest sales…
-
4
votes2
answers3123
viewsError saving Datetime type field
I am mounting an example of Code First, but when saving a field of type Datetime in the database returns me the following error Conversion of a datetime2 data type into a datetime data type resulted…
-
3
votes1
answer794
viewsDbedit apparently not linked to Tadoquery
I have a ADOConnection, one ADODataSet, DataSource, ADOQuery, one DBGrid and a DBEdit. The DBEdit is with the property DataField = numero. A button with the test: AdoQuery1.close;…
-
3
votes3
answers401
viewsSQLSERVER error in C#application
I have a problem related to the SQLSERVER database. I try to connect from a point to the server and error appears: Instance-specific or network error when connecting to SQL Server. The server was…
-
3
votes1
answer80
viewsSQL is importing dates in different format
I am having problems when selecting a date column in SQL Server. It turns out that my data is in format dd/mm/aaaa and when I select this column the SQL reverses getting aaaa-dd-mm and it actually…
-
3
votes3
answers325
viewsData types in SQL Server 2012 and HTML forms with PHP: date and monetary values
How can I put a mask in an HTML form, in the date and monetary value fields, then send this data to the database without having to convert the strings into types date and money? Explain: I have a…
-
3
votes1
answer1018
viewsError converting from varchar to smalldatetime
In the query below the following error occurred: Conversion of a data type varchar into a data type smalldatetime resulted in a value outside the range. Looking at it, I realized that if I take the…
-
3
votes1
answer505
viewsUpdate in two SQL Server tables
How do I perform an update at the same time on two different tables? I have a table called Tarefa and another call VinculoReferencia, both have the field Taridinclusao where is this field that needs…
-
3
votes1
answer268
viewsSelect of Product Structure
Good morning! there is some way to create a query that brings the "product" and all the "Components and Subcomponents" of the structure of this product? Let me try to explain better Structure…
-
2
votes1
answer593
viewsHow to use LEAD and LAG using a condition
My question is, if I can use LAG and LEAD, using a condition in the query, for example: I have the spine cep.. I want to take the value of the next row, and the value of the previous row of that…
-
2
votes2
answers160
viewsBest high availability path for my need
I have studied a lot about high availability in SQL Server, in its most diverse options, that SQL Server has. But so far I could not find the solution that better meets my need. My setting: I need…
-
2
votes1
answer40
viewsSQL Server 2008 Managment Objects: Can I uninstall?
Please, it’s a simple question. I’m starting to study SQL and I downloaded the 2012 Express version. With it came SQL Server 2008 Managment Objects. I can uninstall without any worry or it is…
sql-server-2012asked 9 years, 7 months ago vitorhugo 21 -
2
votes1
answer42
viewsSqlserver 2012 - Column '' in table '' is of a type that is invalid for use as a key column in an index
After seeing this error when creating a NONCLUSTERED index I wondered if it would really be necessary to create this index in the following scenario: I have a table with 11 columns, a column I save…
sql-server entity-framework entity-framework-6 sql-server-2012asked 9 years, 6 months ago Ricardo 5,680 -
2
votes1
answer3605
viewsA cursor inside another sqlserver cursor
I know I could do a tab1 Join with tab2, but that wouldn’t be the case, I need both cursors. When I run I get error from: A cursor with the name 'cursor_tab2 ' already exists. The cursor is already…
-
2
votes1
answer431
viewsSQL Server 2012/BCP crashing - Unexpected EOF
I want to upload some data files from Ministry of Education (2012 Higher Education Census Microdata) in my SQL Server 2012 Express. The data is in fixed column files generated by some program…
-
2
votes2
answers156
viewsError: Cannot find data type long
I am trying to create a precedent in SQL Server 2012, but it is giving the following error in signing it. Mensagem 2715, Nível 16, Estado 3, Procedimento MINHAPROCEDURE, Linha 6 Column, parameter,…
-
2
votes0
answers299
viewsSelect from a table within a cell of another table
In the SQL SERVER 2012 it is possible to construct a table that in one of its columns contains the result of another table? The master key would be the reference.…
-
2
votes3
answers8342
viewsSELECT in a table using NOT EXISTS SQL (SERVER 2012)
I’m trying to make a select tb1 using Where NOT EXISTS (select* tb2) I am trying to select the line in tb1 that does not exist in tb2 to perform an INSERT later. But when testing in select it is not…
-
2
votes2
answers147
viewsHow do I migrate Code First without deleting data from the table attribute?
I need to change the attribute name of Heaviness for Pesoproduct, this is the code that is generated after executing the command add-Migration: namespace Web.Dominio.Migrations { using System; using…
-
2
votes1
answer74
viewsDoubt - Insert SQL Server 2012 table
I need to insert some information in the table called task, however, only when a certain condition is accepted that in the case of these two date fields, I put it for today for example if it was…
-
2
votes3
answers58
viewsSQL Query - Doubt Condition Dates
Guys, good afternoon! I’m having difficulty in the consultation below. I want you to bring all the tasks only when their salary (tarexpiration field) is equal to the month after the opening date…
-
2
votes2
answers395
viewsHow to extract the date-time of a given XML field in a string - Query SQL Server 2012
Good afternoon! Guys, in my log table there is a field called logdescricao and in this field it stores several expressions. For example: <log expressao="7085"><par traduzir="N">André…
-
1
votes2
answers1731
viewsI can’t restore my backup
I backed it up once and it all worked out. Now more tables, views w wtc have been created and I need to update the database. As the bank is at a network address and for security, we have no way to…
-
1
votes1
answer91
viewsHow to Perform a Procedure at Every Insert?
When I go to register I want according to the selected category to record a moderator id, in the question table. select idcategoria from tb_pergunta select idmoderador,idcategoria from tb_moderador…
-
1
votes1
answer1342
viewsAvoid saving duplicate data
In my project I have a rule that is not to save and not to show in Grid duplicated data. For example, in the system I read a XML and with the exception of tags in a table in my database so that this…
-
1
votes1
answer2043
viewsWhat is the difference between OUTER APPLY and INNER JOIN in Sql Server?
What’s the difference between OUTER APPLY and INNER JOIN in the Sql Server? I know how the LEFT/RIGHT/INNER JOIN works but I came across the OUTER APPLY I read it but I didn’t fully understand it,…
-
1
votes3
answers4632
viewsSqlserver Select in XML field
I need some help with the situation below: In my table Sqlserver 2012 I have a field with xml values, I would like to select the data of this field and show the result in columns form. Image 1…
sql-server-2012asked 8 years, 7 months ago VAraujo 65 -
1
votes1
answer182
viewsFormsauthentication causes an infinite redirect error - ASP.NET C#
Good afternoon, I am developing an ASP.NET application with C# that requires login, works and is being used this way: protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new…
c# asp.net visual-studio-2015 sql-server-2012 forms-authenticationasked 8 years, 7 months ago Kawaii 151 -
1
votes1
answer156
viewsSQL Server 2012 Installation Error
I formatted the note and installed windows 10, I went to install SQL Server 2012 that always used, but this time did not work. See the error: Have solution? The error is known as 1935.…
sql-server-2012asked 8 years, 7 months ago HeyJoe 819 -
1
votes0
answers26
viewsCreate Partition
I’m sharing a table in my database, I created Function Partition and Scheme Partition. But when I go to Create Partition Wizard the Radiobutton Existing Partition Function gets disabled even with…
-
1
votes1
answer923
viewsSQL query to return only if capitalized
I would like to make a query in a column and that the return is only the uppercase words that correspond to the searched criteria (user input), no matter if the criterion was typed in uppercase or…
-
1
votes1
answer26
viewsSQL Server 2012 - Generate query from one table to another involving 3 (three) tables at once
Hello, Community! I need help with the logic of a consultation I have to do on SQL Server 2012. Well, I have three tables: [1'] operacao_apf; [2] operacao_contrato; and, [3] operacao_detalhe. What I…
sql-server-2012asked 8 years, 3 months ago StillBuggin 2,012 -
1
votes0
answers29
viewsMobile Report - Reporting Services 2016
This is my first post in the community and I hope to be able to collaborate with my question. I am working on a BI project where I need to show a quantitative number of calls on a map, according to…
report sql-server-2012 reporting-services sql-server-2014 business-intelligenceasked 8 years, 1 month ago Rafael Lima 111 -
1
votes1
answer763
viewsHow to return the records between two values with the SQL Server Database?
Example of my table: My question is this... On my featured news page have to appear the 2 latest news and on the secondary news page have to appear the 2 other news in sequence. Example: in the…
-
1
votes0
answers443
viewsSQL Server Error When Converting Varchar to Integer Type
FOLLOWS THE ERROR Msg 245, Level 16, State 1, Line 2 Conversion failed when converting the varchar value '280-64460-2' to data type int. SQL DONE USE TOXICOLOGICO SELECT NomeUnidadeColeta,…
-
1
votes1
answer202
viewsError run UPDATE SQL Server
When executing the update statement below is occurring the following error. What can be? Msg 116, Level 16, State 1, Line 3 Only an expression can be specified in the selection list when the…
-
1
votes1
answer129
viewsWhen is Trigger SQL server triggered After Insert?
When a Trigger is fired after an Insert and the Insert is within a transaction, Trigger is executed at the time of the Insert or at the end of the transaction?
-
1
votes1
answer146
viewsSelect does not return broken value
I have the following command: SELECT CAST(450/4 AS DECIMAL(15,2)) Return: 911 where the right one would be 112.5 Because of that? NOTE: My SCRIPT is in a precedent, but roughly my problem is in this…
-
1
votes2
answers1521
viewsQuery SQL - put result in a row only
SELECT pga.Titulo, e.Codigo FROM Qualidade_Diagrama_Processo_Grupo_Acao pga JOIN Qualidade_Diagrama_Acao_Entidade ae on (ae.Id_Proc_Grupo_Acao = pga.Id) JOIN Qualidade_Diagrama_Entidade e on (e.Id =…
-
1
votes1
answer202
viewsSELECT with intermediate table returning all values in the same field and separated by comma
I have the tables (and their relationships) of the diagram below: I need to do this: Bring all the fields of the TBCADCRE table and an extra column called ADQ with all the TIPADQ that the user has…