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
answer33
viewsQuery Transformation
Does anyone know if it is possible to transfer a SQL SERVER query into a new table? No longer query to be shown with a "show table" command made from a query for example ?
-
0
votes0
answers26
viewsAzure Data Studio - How to shortcut to open procedures?
Fala galera, I am using Azure Data Studio and I know that there is a shortcut (F12) to open a Procedure, the problem is that when I open this shortcut, the existing file opens with the CREATE…
-
0
votes1
answer269
viewsHow to convert Datetime to timestamp? (SQL SERVER)
Today I have the following situation, I need to send the current date and time of the request in an int format, as image below Below are some attempts I made, but when testing the conversion to date…
-
0
votes0
answers21
viewsHow to verify and manipulate native LOG in Sqlserver?
I am working in an application generating a Batch service being developed in T-SQL. Just like Mysql and Postgresql have their LOG files, where are these LOG files in Sqlserver? Another question is…
-
0
votes1
answer47
viewsSet which value will be stored in a PHP variable to be saved to the Database
I have an HTML page where the user selects the information he needs and stores it in the database when he completes the operation. It is a small form in which there are practically only check boxes,…
-
0
votes0
answers35
viewsAccess to remote server denied because there is no login mapping
I’m trying to access data via Excel that searches the data in the database. Only when consulting the data gives the error below: When seeing the details of this error Detalhes: DataSourceKind=SQL…
-
0
votes1
answer442
viewsConnection Sql Server Database . MDF does not work C#
My error application when I try to run on another machine, only on this machine I have nothing sql server installed, what I need to run my application on any pc? Follow the error:…
-
0
votes1
answer161
viewsMSSQL query on Ubuntu 18.04 LTS has stopped working
I have a program that has been running on Ubuntu-server 17 for some time. This system performs queries on a database server with MSSQL 2008. I performed the installation of Ubuntu 18.04 LTS, and did…
-
0
votes1
answer49
viewsSQL - How to bring only rows (ID and Date/time) with less than 1 hour
I need the following help: I have a table that I need to compare the transactions with the same ID, but only bring those ID lines that have the previous transaction with the same ID with less than…
-
0
votes0
answers788
viewsLocal database . MDF C# Visual Studio 2017 (CONNECTION)
I am developing a windows application using visual studio 2017, but I came across a problem, on my machine that I am doing the project everything runs right, on the other machine that I do the tests…
-
0
votes0
answers47
viewsFileupload file format saved in sql server database 2008 with Image type
I have a problem finding the right encoding for a file that is saved in the database through Asp.net Fileupload in sql server 2008 database with Image type. I need to migrate from a web system to an…
-
0
votes0
answers62
viewsHow to import a . csv file to a Stored Procedure on SQL Server without using "BULK INSERT"?
I am trying to perform an SP that lists the . csv files in a folder via the command XP_CMDSHELL And then imports the files. csv for an auxiliary table in the database, but I do not have permission…
-
0
votes1
answer66
viewssynchronize nosql and relational databases
I have an Asp.net application that uses the CQRS architecture standard and two databases one relational with Entity framework and one with mongodb. The question is at the end of the day, or in parts…
-
0
votes2
answers568
viewsDatabase connection error . MDF C# Visual Studio
App.Config <connectionStrings> <add name="conn" connectionString="Data Source=.\SQLExpress;AttachDbFilename=C:\Sistema\Sistema.mdf;Integrated Security=True"…
-
0
votes1
answer340
viewsHow to define multiple variables at once within a Trigger in Sqlserver
Hello, I am creating a TRIGGER where I must do a series of treatments after an UPDATE in a table in Sqlserver. In this TRIGGER, I need to define some variables so I can work with them in the rest of…
sql-serverasked 6 years, 5 months ago LeandroLuk 4,989 -
0
votes1
answer32
viewsHow do I convert a date into varchar?
How do I convert a date into varchar? I tried to convert to normal mode but couldn’t, could anyone help me? I want DT_PAGAMENTO to be in "03/02/2021" format, in dynamic mode. SELECT NUMERO =…
-
0
votes1
answer120
viewsSUBSELECT WITH COUNT(*) SQL
SELECT CPF FROM ZPCF WHERE CPF IN (SELECT TELEFONE, COUNT(*) FROM ZCPF WHERE GROUP BY TELEFONE HAVING COUNT(*) > 1) I need you to bring Cpf along with phone numbers, there are phones registered…
-
0
votes0
answers23
viewsSelect in dynamic XML returning all possible values within the tags - SQL SERVER
i wonder if it is possible to select in an XML bringing all possible results within select and stored in a variable XML: <Nome>@PartyId</Nome><Nome>@CallId</Nome> The tag…
-
0
votes1
answer61
viewsHow to improve this sql code?
I would like to improve this code so that it does not repeat the same code in both Ifs. I don’t feel like using procedures because I don’t see the need. DECLARE @Ordem VARCHAR (7), @Valor…
-
0
votes1
answer145
viewsUnfold lines in a date range
I have a question regarding SQL SERVER and I needed your help. I have a Query that returns me a line with a number, Start_date and End_date. Consultation: select 123456 as Numero, a.Data_inicio,…
-
0
votes1
answer20
viewsSQL to group records
I made the query below to load the records with the highest date of exit (a same record may have several dates): SELECT RA, MAX(Data_Out) AS Data_Saida, Placa FROM dbo.RA_Vehicles GROUP BY RA, Placa…
-
0
votes0
answers13
viewsUser Access Control by Pespectiva
I set up a Cube on the Analysis Server and created several pespectives from it. The idea is that users consume the data from these. It turns out that I wish a given user could only see a single…
-
0
votes0
answers103
viewsAsp.net error connected to sqlserver
I have this code: <head runat="server"> <div class="barraCima"> <img class="simbolo" alt="icon" src="images/doctor.png"/> </div> <div class="main"> <div…
-
0
votes1
answer59
viewsSelect result feeding other 2 selects
I have the select 1: SELECT DISTINCT SD2.D2_DOC AS NOTA, CONCAT(RTRIM(SD2.D2_CLIENTE), ' - ', SA1.A1_NOME) AS CLIENTE, SD2.D2_COD AS CODPRODUTO, QEK_REVI AS REVISÃO, SD2.D2_LOTECTL AS LOTE,…
-
0
votes1
answer259
viewsHow to create a Function that calculates CRC16 in SQL Server?
can tell me if there is any sql function that calculates CRC16, the calculation method is listed as "CRC-CCITT (0xFFFF)". CRC-CCITT (0xFFFF) -> polynomial: x 16 + x 12 + x 5 + 1 I tried to create…
-
0
votes1
answer1132
viewsHow to view data from an SQL Server query using PHP?
I’m trying to display data from a table in my database SQL Server, using the PHP, but I’m not getting it. Not error code but also returns nothing. The code is this one: <?php $serverName =…
-
0
votes2
answers51
viewsError Backing Up Windows Forms Database
Guys are having trouble solving this problem! My application is in Windows Forms. I need to perform Backup of data through the application itself, but when I run to perform it informs me of this…
-
0
votes2
answers58
viewsImport Excel data to table in SQL Server (only data other than that already in the table)
I just want to add different records than the ones already in the table, that is, they would only be records from Idcollaborator 10.…
-
0
votes0
answers13
viewsAccess the SSIS catalogue via SSIS
I need to create a process on SSIS SQL Server Integration Services that can extract from each project which tables are being used. The end result is to get a table that is automatically fed with two…
-
0
votes0
answers14
viewsUnable to generate the model because of the following Exception: 'System.Argumentexception: ', hexadecimal value 0x08, is an invalid character
When trying to generate the template layer of an existing database (Sql server) I get this error. What should I do ?…
-
0
votes1
answer32
viewsError formatting ZIP with Format() function
When trying to format the data of the CEP variable, SQL Server returns the following message: Argument data type varchar is invalid for argument 1 of format Function. Just follow my code: DECLARE…
sql-serverasked 3 years, 5 months ago Kelly Soares 1,181 -
0
votes1
answer223
viewsSQL SERVER Filter
I have an exercise to do but I’m cracking my head here: "SQL command that brings me the sum of the salaries received per employee and status in the year 2014 of the tables: SALARIES / EMPLOYEES /…
-
0
votes1
answer71
viewsTake only the values that are different in the query
I made a query that brings the values of credit and debit, but I need to bring only the values that are different from these two fields. At the moment I do not know why it is bringing all. Look at…
-
0
votes0
answers27
viewssum the values of the repeated names in Datagridview
Hello, folks all right, I have an application where I add the items in Datagridview, however I want to add the volume values, the lines that are with the same name, I want to create a variable to…
c# sql-server entity-framework winforms visual-studioasked 3 years, 4 months ago Mecleudio Queiroz 31 -
0
votes1
answer97
viewsImage upload using Picturebox - windows Forms
This is Galera, good morning! I have a small problem and I can’t solve it, it’s the first time I’m using c#Picturebox, my application is Windows Forms. and I’m making a record using photo! but when…
-
0
votes1
answer25
viewsDifficulty in dynamizing columns in MSSQL
Gentlemen, good morning ! I’m having a little trouble building this query in Microsoft SQL 2019 Could someone maybe give me a light ? I have a base like this Codfuncionario | cod_centro_custo |…
-
0
votes3
answers222
viewsDecimal problems in the SQL string
I have an error: every time the variable c.Value_do_title passes the SQL string, automatically the "." that separates the Decimal is converted to ",". As you can see in this image, the variable is…
-
0
votes1
answer23
viewsDoubt to return a query
I have the following problem, in sql server I have a table of contracts and one of clients where returns as follows: In Where condition I need to pick up only the last created id of each customer’s…
-
0
votes0
answers12
viewsFormatting of DATA SQL
How can I know what causes this ? 2021-07-27T12:08:25.863Z, the serious ideal the select back 2021-05-17 10:26:10
-
0
votes0
answers24
viewsHow to read an entire SQL Server table and update another one?
I need to do a massive daily processing where I need to read a table my row by row and apply some rules and in the end update a column from another table. What would be the best way to make this…
-
0
votes1
answer528
viewsLock registry (lock) in SQL Server
Using SQL Server and Delphi, I need to control so that in a certain database table two changes cannot be made at the same time in the same record, I cannot start the update if there is already…
-
0
votes1
answer56
viewsRun an XMLA query using C#Webapi
My C# Webapi looks like this. using Microsoft.AnalysisServices.AdomdClient; using System; using System.Data; using System.Web.Http; using System.Xml; namespace FastReport.WebApi.Controllers {…
-
0
votes0
answers67
viewsWHERE failure when associating a query column in a view
I am passing some parameters to a view where I need to receive the return of this query. When setting the filters in the Where of my query, the return of the query informs the following error:…
-
0
votes1
answer566
viewsHow to add equal amount SQL?
I have the following query: SELECT DISTINCT CTRL_CARGA_PED_VENDA.CtrlCargaNum, ITEM_PED_VENDA.PedVendaNum, PRODUTO.ProdCodEstr, PRODUTO.ProdNome, Sum(ITEM_PED_VENDA.ItPedVendaQtd) AS QtdItem FROM…
-
0
votes3
answers200
viewsHow to Merge 3 Select into One
I wonder how I could make one SELECT where I can bring the same resulting however in a single SELECT. Example of the select I need to be single: SELECT COUNT(*) AS QtdTarifados FROM tblLoteTESTE…
-
0
votes2
answers69
viewsMatch table data on Linkedserver servers
I have 3 Linkedserver servers (the 3 having the same tables with the same fields). Server 1: First server Table: Test Server 2: Second server Table: Test Server 3: Third Server Table: Test Select to…
-
0
votes1
answer232
viewsDynamic php SQL Server Quiz
Hello, I am building a calibration tool (given a Checklist the user needs to select the fields that are in agreement (or not) with a link or script. Ex.: 1)Colaborador inicia o atendimento conforme…
-
0
votes1
answer54
viewsSelect do not return repeated based on a column
I came across a situation where I have a register of customers who may have more than one address in the related tbEndereco table and an address may belong to more than one customer. But when…
-
0
votes1
answer58
viewsResult of the come zeroed query
Good Afternoon, I have a question, could you help me? ... What happens is: I have an sql query that brings me the total amount of sms sent per month and year, but I would like when I had not worked…
-
0
votes1
answer916
viewsWhen is it valid to use XACT_ABORT() in a script that is already using TRY/CATCH?
Assuming the following code: /* DROP TABLE #Teste; CREATE TABLE #Teste(id INT); INSERT INTO #Teste VALUES(1); CREATE TABLE LogErros(id INT IDENTITY(1,1) PRIMARY KEY, nomeTransaction VARCHAR(100),…