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
-
1
votes1
answer94
viewsSql - Concatenate values if field is equal
I have the following select: SELECT c.codigo ,c.situacao ,c.fk_aluno FROM tb_cad AS c INNER JOIN tb_aluno AS a ON c.fk_aluno = a.id order by c.fk_aluno I need when c.fk_aluno is equal, agglutinate…
-
1
votes2
answers1012
viewsDuplicate keys
** Improving the Post to better understand what happened. Person, good afternoon. I created a table 'client' in sql server and put the email field as vachar(50), Unique and null accept pq by logic,…
-
1
votes1
answer418
viewsHelp with a PIVOT ( Sql Server )
Guys I looked for many examples of Pivot but I could not understand... and I’m just not able to use in my select... what happens, I’m having this result :…
-
1
votes1
answer45
viewsHow to make a select where the order "Group" is shown after "Child Groups"
As it is a system that contains registration of Product Groups. I want to know how to make a select that brings me the information in the following order inside SQL and ordering everything…
-
0
votes2
answers315
viewsInsert error with Adocommand
In Delphi XE4, SQL Server 12, connected by ADOConnect. ADOCommand1.commandText being 'insert into tabela (a,b,c) (1,1,1)' It works as expected if a record already exists. But if it is the first…
-
0
votes2
answers729
viewsHow to fill datagrid in a form with fields in another form C#?
I’m making a loyalty system, and I wanted to use two forms for customers, Form1 with the datagridview and a button register and the other form2 with the data fields to be filled in, that form2 would…
-
0
votes1
answer1278
viewsHow to put an SQL command in a variable
I have a following SQL command and I need to put it inside a variable in SQL. The code is this. WITH DB_CPU_Stats AS (SELECT SUM(total_worker_time) AS [CPU_Time_Ms] FROM sys.dm_exec_query_stats…
-
0
votes0
answers378
viewsCall Procedure sql server via JDBC which returns cursor
I am unable to call a Procedure SQL Server in java that returns a cursor. That’s possible, someone has some example ? Through Oracle, through the example:…
-
0
votes0
answers135
viewsCakephp SQL SERVER
I’m in big trouble here. I have a cakephp application hosted on the Windows server. The following problem is happening: The save method of NO model is working. In debug I search for validation error…
-
0
votes1
answer5001
viewsRemote procedure call failed. [0x800706be]
After installing SQL Server 2008 R2, access SQL Server Management Studio but server name does not appear and SQL Server Configuration Manager services are not active.…
-
0
votes1
answer49
viewsI can’t give a Grant in a schema
I am working with an SQL Server 2012 database and I am trying to assign a Grant to a schema with the following command: GRANT INSERT ON SCHEMA :: trunk TO trunk And I’m having the following mistake:…
-
0
votes1
answer755
viewsLocal instance of SQL Server 2012 is missing
I installed SQL Server 2012 with SQL Server Manager to interact with the database. I logged in locally, saw db master. I disconnected (I don’t remember if I restarted the machine) but I went in…
sql-server-2012asked 9 years, 1 month ago hyperpixel 389 -
0
votes0
answers74
viewsquery a term in several SQL tables
I have tables with names. Table "Alphabet" contains only names starting with letter A and so on until table "Letter Z". Task: Search any name in all tables and locate it.
sql-server-2012asked 9 years ago dezoldan 31 -
0
votes3
answers645
viewsSQL Server subquery is always returning null. How to fix.
I have a Procedure and a COMMON TABLE EXPRESSION(subquery). This my CTE does a search and offers to my query the result, my query then uses the results of it. In my table Address I have a field…
-
0
votes1
answer327
viewsHow to compare two dates in Datagridview and change color when VB.Net expires
My code Private Sub CadastroDataGridView_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles CadastroDataGridView.CellFormatting If…
-
0
votes3
answers112
viewsINSERT method with PHP OO error using SQL SERVER 2012
This is my class connection in the database class Conection { private $_host = 'ALISON\MSSQLSERVER2'; private $_user = 'banco'; private $_pass = '123456'; private $_database = 'aulateste'; private…
-
0
votes1
answer134
viewsSQL Server 2012 - SQL Server authentication login
At the installation I put a password and wrote it down. When I am going to log in for SQL server authentication the login field is empty, I just wrote down the password I don’t know the login. I…
-
0
votes1
answer65
viewsQuery with SQL Server query
I have the following query in SQL Server, to return me a list of cities I need. select IDCidade as "ID", case UF when 'RS' then '1' when 'SC' then '2' when 'PR' then '3' when 'SP' then '4' when 'RJ'…
sql database sql-server query sql-server-2012asked 7 years, 11 months ago Luís Felipe Dal Molin 169 -
0
votes3
answers378
viewsDoubt SQL query d
I am wanting to perform the calculation in sql query where the result is the number of open calls divided by the number of working days chosen period. Ex: They were opened 200 calls in the month and…
-
0
votes3
answers171
viewsDoubt - Update SQL Server 2012
When the update below is run for the first time, the field comes out correctly in the way I want it to be below, but if I run it again, it comes out that way. What I want is that regardless of how…
-
0
votes1
answer1114
viewsHow to decrypt records from an SQL column - Query
Good morning! Guys, how to decrypt records from a column in an SQL query. The field I want to decrypt is the coluna MAX(A.Descricao) [Descrição da Última Providência]. SELECT…
-
0
votes1
answer235
viewsUpdate with select CTE Error
I am having difficulties to perform an update with select CTE. I want to update the charging field. Below is the query and just below is the update I tried to perform, but the following error…
-
0
votes0
answers51
viewsGenerate sql script on a given date
Good afternoon! Guys, I have a big mission here. I have a script that I assembled below that I need it to be executed only on the 1st of each month respecting the two conditions I put in the IF…
-
0
votes1
answer1224
viewsSQL Server connection in the Laravel
Guys, I’m making the following mistake: sqlstate 08001:[Microsoft][odbc driver 11 for sql server] tcp provider: no connection can be made because the target machine actively refused them. I am using…
-
0
votes1
answer647
viewsHow to add SQL Server primary key?
Good morning! maybe it is simple my doubt, but... I would like to know how to add primary key in a table not being at the time of creation (CREATE), I know that when accessing the table in "Object…
-
0
votes2
answers259
viewsInsert Select Sql Server
Connection and Historico_ligacao I have a script which copies all data from the table Ligacao for Historico_ligacao. When I compare the data between the theban, the table historico_ligacao is…
-
0
votes2
answers42
viewsSQL formatting field
I have the following structure: |VALOR| | 1 | | 23 | | 5 | | 41 | I have a need to transform: | VALOR | | 0001 | | 0023 | | 0005 | | 0041 | Is there any function I can do that?…
-
0
votes1
answer32
viewsSelect Same Field
Hello! I need to make an SQL that gives me the result and I wish in the same line. Today SQL is skipping a line. I need you to stay on the same line. select c.empresa, p.nome, (select…
-
0
votes2
answers43
viewsHow to find the value from accumulated balances
In my SQL Server, have a table containing the registration of odometer of vehicles with the value end of each month. I need to know what the value that each vehicle toured monthly on the basis of…
-
0
votes2
answers412
viewsSql Server - Does checking for field NOT work if to avoid select?
Please consider the script below.. He checks if there’s such a thing in a table, if there is one, he selects it. Then check again if it exists (only for didactic fims ;) and existing Dropa the…
-
0
votes1
answer149
viewsHow to insert xml tag within a sql server table
I am trying to insert an XML tag that is allocated within a field in an SQL table (SQL SERVER) I am currently trying so but am unsuccessful: update UserData set tp_ColumnSet.modify('insert…
sql xml sql-update sql-insert sql-server-2012asked 5 years, 5 months ago Guilherme G. Bitencourt 11 -
0
votes1
answer48
viewsAdd values with different codes
good evening, I have the script below: SELECT Month([doacao_total].[doacao_sdt_data]) AS MES, Year([doacao_total].[doacao_sdt_data]) AS Ano, Sum(doacao_total.doacao_mon_valor) AS [Valor_doacao],…
-
-1
votes1
answer1744
viewsConnect SQL server with PHP
I’m trying to connect a Sqlserver 2012 using php 5.3 with the driver sqlsrv, however even managing to connect with SQL management studio by php always return me the error [Microsoft][SQL Server…
-
-1
votes2
answers1495
viewsSQL Server Function - Holidays
Good afternoon! Dear friends, I have the following function below that is the days not worked that are coming only Saturday and Sunday, however, I wanted to include in this function the holidays.…
-
-1
votes3
answers240
viewsView does not appear in query - Sql Server
I have a 2-field view that does not appear in the query window. When I add 3 more fields, it appears. What can be?. View: SELECT B.TX_LOGIN, COUNT(A.CD_PROCESSO) AS TOTAL FROM dbo.TB_DUE_CAPA AS A…
-
-1
votes1
answer80
viewsOracle REGEXP_REPLACE equivalent in SQLSERVER
In my application I need to remove common string words of the database, such as: FROM TO WITH Which are connecting words and have no great importance in characterization of the item itself. Say the…
sql-server-2012asked 4 years, 8 months ago Reginaldo Rigo 3,638 -
-2
votes1
answer477
viewsError when entering monetary value into bank
I am trying to save the value 137421,20 in a table of Sqlserver with a field of type Numeric(8,2). However I get an error with the description: "Parameter value 137421,20 is out of range." I’m…