Most voted "sql-server" questions
SQL Server is a relational database management system from Microsoft. Use this tag for all SQL Server editions, including Compact, Express, Azure, Fasttrack and PDW.
Learn more…2,752 questions
Sort by count of
-
0
votes1
answer125
viewsPerforming temporary table comparison
Good morning, I have doubts about how to compare a temporary table with a database table. What I want to return is, among all the data of the temporary table it returns the ones I have in the…
-
0
votes1
answer71
viewsHow to Download SQL Server File using Servlet
I have a basic application where I save files in the database SQL Server using Java, the part of insert into the bank I’ve done, I’d like to know how to download the file that is in the bank via…
-
0
votes2
answers69
viewsDoubt with a query (SQL Server)
Good afternoon! I have a set of information in an SQL Server database (I’m still learning SQL Server), and need to filter the information that is returned to me. They are information of employees of…
-
0
votes0
answers98
viewsSQL Server extension not found
I’m trying to create a connection with Sqlserver through PHP 7.2 NTS, and even trying all possible combinations of DDL’s I’m not even getting up the built-in server. my setting is as follows:…
-
0
votes1
answer51
viewsAdd up the Count results
I am developing a system, and in case I have the following query in SQL (SQL Server), the query is as follows USE REPORT GO SELECT TOP 10 r.[PONTO DE ATENDIMENTO] , r.[CIRCUITO], count…
-
0
votes0
answers153
viewsSQL query duplicating data
I am using the following command to get the daily total sale by way of payment! So as I present below it works perfectly: " SELECT t.DataDocumento, SUM(t.Valor) Total " + " FROM VendaCliente v " + "…
-
0
votes0
answers311
viewsImport data from xlsx file to SQL Server
Hello, I am creating a SP to export data from a spreadsheet in xlsx format (Excel ), however I am not succeeding. My SQL SERVER is an older version of SQL Server 2000 (Build Version 8.00.2187), and…
-
0
votes1
answer61
viewsAdd result from POINTS column
Good afternoon! I have the following situation: I have a table with the results of some football games. I managed to assemble a SELECT and assign 3 points to the winner and 1 points to the draws.…
-
0
votes1
answer51
viewsSet primary keys in sequence
I have the table empresas as an example: cod | nome ----|---------- 3 | Asterix 7 | Lunar 13 | Coimbra Fortunately the table of companies currently has no reference in another table, I would like to…
-
0
votes2
answers697
viewsProblem renaming column in Sql Server table
I needed to rename a column from a table in Sql Server and used the stored SP_RENAME system processor. I used it as follows: USE [meu_db] GO EXEC sp_rename '[dbo].[minhaTabela].[minhaColunaAntiga]',…
-
0
votes2
answers325
viewsHow to insert data into another database with Linked Server
Good afternoon! How do I create a trigger that uses a Linked Server to insert the INSERTED data in another table that is in another database, this in another server? Trying to Exemplify: CREATE…
-
0
votes1
answer136
viewsHow to check different data and get the first SQL record?
I need to create a filter in SQL that follows some rules, I have a spreadsheet in Excel and in it I need to apply the following filter, the spreadsheet has the fields: GSM MOTIVO_ENVIO DATA_ATIVACAO…
-
0
votes2
answers147
viewsTake duplicity by ignoring a column with distinct information
I searched here and found nothing like it. When I make the following Select : SELECT a.idEmpregadoReserva as Controle ,(select EmpresaAplicativo from tbEmpresaAplicativo where…
-
0
votes0
answers98
viewsConnection of SQL SERVER 2014 to NET BEANS
I’m new here and this is my first question... So I can’t at all connect SQL SERVER with NET BEANS.... I put JDBC already in the library folder, followed several types of tutorials on youtube and…
-
0
votes0
answers41
viewsHow to know which is the SQL server tool?
I am at Visual Studio 2017 which is connected to the SQL server database ,SQL server is running on the Linux server, this server is running in the cloud. What I am trying to do is copy the database…
-
0
votes1
answer63
viewsHow do I modify a local scope variable within a function?
Basically I want the function below to return a Boolean so I know if the transaction has occurred successfully or not : public persistirPagamento = async (agencia: string, banco: string, conta:…
-
0
votes1
answer328
viewsHow to return the last Record of an SQL column in a textbox?
I am developing an application for my technical course that will register customers, in case I would like that before registering the client the field code returned the last code of the table sql +…
-
0
votes2
answers92
viewsError doing Insert in BD SQL using JDBC
I need to do an Insert using JDBC Connection, but inserting generates the error below. com.microsoft.sqlserver.jdbc.Sqlserverexception: Conversion failed when Converting date and/or time from…
-
0
votes1
answer137
viewsmvc application with visual studio code, Connection Strings
I am using Visual Studio Code with the extension mssql on linux and need to get the Connection String from a database I’ve already created, but I’m not getting. The teacher of the course that I am…
-
0
votes1
answer794
viewsSQL Server Row Number Counter
how do I perform a counter on the sql server from a certain number. Example below. Current result Ticket Ação 42977 1 42977 2 Expected result 42977 3 42977 4 42977 5 ---Below the query--- The first…
-
0
votes2
answers95
viewsQuery including multiple tables
I have a people table that has people from funcionarios, pais and maes, I’ve managed to relate everyone. Just look at the way it returns. I need the maes stay in the first line, just like the pais.…
-
0
votes1
answer483
viewsSorting 2 Columns at the same time SQL Server
I have the following table structure. Ticket | Data | ID The data field is datetime, ticket, id and generator are int. What I need is for ticket and date fields to be sorted at the same time.…
-
0
votes1
answer625
viewsError converting varchar data type to float
I have a stored precedent to change a field of tables of varied name: CREATE PROCEDURE usp_alterarCrachaCadAce --PARÂMETROS @NomeTabela VARCHAR(20), @CrachaDestino FLOAT, @CrachaOrigem FLOAT AS…
-
0
votes2
answers553
viewsCopy data from one database to another?
Good afternoon, I am beginner in sql server and I came across a situation that raised this doubt. I wonder if it is possible to copy a table from one database to another, in the situation where both…
-
0
votes0
answers49
viewsDifficulty connecting VB6 projects to the Database on using Availability Group Listener in the Connection string
Our scenario is using MSSQL database configured for High Availability and Listener was created to link the balance between instances. Some applications made in Asp.Net MVC projects we managed to…
-
0
votes0
answers96
viewsWin32exception: The network path was not found
I am getting the following error in my application that is hosted on aws Sqlexception: A network-Related or instance-specific error occurred while establishing a Connection to SQL Server. The server…
-
0
votes2
answers143
viewsStored Procedure Doesn’t Deliver Results You Should
-I am very new in SQL, Spring & Java, I am trying to set the results of a list that returns in a Query I created -this query returns a list with the referenced object -the parameters are all…
-
0
votes1
answer114
viewsFill a Checked List Box with SQL Server values
I am creating a form that I would like it to work as follows: First the user would select the type of exercise that would be played in the Checked list box using a Combo Box, then the bank would…
-
0
votes0
answers33
viewsSQL Server Grouping Conditionally
I have the following problem. I have a relationship between 2 tables (1)Tb_log_relac_nfs and (2)Tb_fat_notafiscal_item. Table 2 is where I write both input and output notes. 1 is one that stores the…
-
0
votes2
answers46
viewsLog datagridview data into a table in the database
Good afternoon, you guys! I have a problem with doing a data insertion presented to my datagridview. I have a table called Events, and it contains all my records, I created another table with the…
-
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
votes1
answer41
viewsHow to create a precedent that accesses a substring and calculates using the substring as parameter?
I need to create a precedent that according to the substring of a title, calculate the average price of books with the substring passed as parameter, and the average price needs to be an output…
-
0
votes2
answers198
viewsConditional help in SQL WHERE
Come on, guys, I’m putting together an SQL query. In this query, the field SD1010.D1_TES can assume N values, but if this field is equal to empty, I need one more restriction to be applied…
-
0
votes1
answer1414
viewsSQL Server - Line Break
Good morning, thank you for the time in reading that question. Problem ! Consider the registration line ID | Nome 1 | "Fulano 1, Fulano 2, Fulano 3, Fulano 4" I need to mount a select that when it…
-
0
votes1
answer146
viewsSELECT GROUP BY AND ORDER BY Sql
I have two tables Tb_process and Tb_costs united by key Numeroprocesso. I need lists of their union information sorted by Urgency and Date status. When urgent, they should be listed at the top of…
-
0
votes1
answer354
viewsDoubt when mounting a Where in a Procedure
On the site, I have a filter that already works. This filter will be maintained, but the table will be another, from another bank including. The rule for the filter is, if the parameter passed is:…
-
0
votes0
answers24
viewsRepeat parent group to each child group interaction
I have the following situation. I have a data structure that follows the following hierarchy. 1 Ship has N exporting companies 1 Enterprise exporter owns N export notes 1 Export note has N product…
-
0
votes2
answers759
viewsProblems connecting to sql server with Visual Studio and C#
I have encountered problems connecting to sql server by visual studio with Entity Framework 6. My connection worked normally and after I created a new project, I cannot access the database server.…
-
0
votes1
answer481
viewsError Invalid 'EXAMPLE' column in the selection list because it is not contained in an aggregation function or in the GROUP BY clause
Hello, friends. I am trying to perform a query on SQL SERVER that worked perfectly on Sqlite. Does anyone know how to make it work? Consultation: SELECT B.CLIENTE, A.CODCLI, SUM(A.VALOR-A.VALORPAGO)…
-
0
votes0
answers105
viewsWhy doesn’t my select return in PHP?
I have a PHP query which is as follows: <?php $serverName = "servidor"; $connectionInfo = array( "Database"=>"banco", "UID"=>"user", "PWD"=>"senha"); $conn = sqlsrv_connect( $serverName,…
-
0
votes0
answers40
viewsAutomapper mapping returns Zeroed values
I have the following problem, when executing a query of a procedure, its response to being mapped returns the values of the properties with null value. My Datareader with Automapper Mapping public…
-
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
answer573
viewsIs there any kind of IFERROR in SQL Server?
Assuming the following script: DECLARE @var1 VARCHAR(100) = 'Stackoverflow'; DECLARE @var2 VARCHAR(100) = '10'; SELECT 1 * @var1; SELECT 1 * @var2; If you execute the first select, we will receive…
-
0
votes1
answer229
viewsconnectionString Local Network Asp.Net MVC SQL SERVER
I am trying to connect a bank in my application, which is networked, so I have put the following path: <connectionStrings> <add name="smc" connectionString="Data Source=192.168.0.29;…
-
0
votes3
answers149
viewsSet the value of a TD using a JS function
I have the following function, which returns an entire value of an AJAX query to my SQL Server database. function qtdItensUltimaCompra(){ var url = 'AjaxQtdProdutoInsumo.jsp'; var temp =…
-
0
votes1
answer28
viewsI am doing a search system in my movie view and gave an error regarding the Web request
(I decided to make another post, as advice of another user) In my Movies view there is a list of all the movies you have in the database and I added um botão, uma caixa de texto e 2 radio…
-
0
votes1
answer40
viewsDoubt in self-relational table modeling
I need to make a system where the business rule is this: One card must duel against another card The same duel between two equal cards can happen more than once Each letter should contain only two…
-
0
votes0
answers31
viewsChekbox column in datagridview
I’m getting an error after I put a chekbox column in the datagridview on my screen, and this screen is loaded by a query, put this chekbox column not in the query but directly in the datagridview.…
-
0
votes0
answers27
viewsData from datagridview going from one screen to another
Good afternoon, I have some data that load a datagridview, this data comes from a query in the database in slq, and in that datagrid I have a column with a chekbox, I wanted to know how to do even…
-
0
votes1
answer167
viewsError passing information from a datagrid line of a form to the datagrid of another form
I have a following error when passing information of the selected line from a Form1 grid to the form2 grid Follow the code of the Form1 grid private void button1_Click(object sender, EventArgs e) {…