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
-
2
votes2
answers676
viewsHow to Save Datagridview Items within a Column?
I’m creating a Budget Form, similar to the one in the photo: As you can see, on the New button, I have a new line in the bank with the budget number in the field Código and the customer in the field…
-
2
votes1
answer204
viewsMake a SQL Server process by receiving a special character string and getting only the numbers
Hello, I have a system developed in ASP Classic, in which I select up to 5 times on a screen. These times are sent to the other page via querystring, but the format that comes is followed by an…
-
2
votes2
answers573
viewsQuery in a column with different values
In my project, I have a SELECT which brings me back two names, but these names are different. On my command, I need to return these two different names that are in the same column of the bank in a…
-
2
votes1
answer73
viewsProblem with different encodings between databases
I am creating an application that needs to take some data that is in an SQL Server database with iso-8859-1 encoding, and insert into a Mysql database with utf-8 encoding. A few words with accents…
-
2
votes1
answer165
viewsTime calculation logged in to SQL
I have a system where user logs in and drops the tool several times a day during their work hours. I need to calculate the amount of time it was logged in: The columns LOGOUT and LOGIN are in…
-
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
votes1
answer120
viewsQuestion with Table Update Trigger
I have two tables, questions and answers, and would like to update the same according to what is selected: Sql Server Database 2005 Problem: --usuário excluindo a pergunta (não está gravando a data…
-
2
votes2
answers181
viewsvisual studio sql error
Good people, I’m new in c# and then I’m seeing some tutorials connecting to the database only that this error appears to me: The code I made is all still based on a basic tutorial and I leave it…
-
2
votes1
answer138
viewsHow NOT to cascade delete records with 1-n relationship using Entity Framework?
I have a table Menu that may have many Categories and these Categories may have only one Menu: public class Menu { public int Id { get; set; } public string Name { get; set; } public virtual…
-
2
votes2
answers2556
viewsPick start and end date of one week of the month
Good afternoon, you guys. Today I’m having a problem getting the start date and end of a week of the month. Let’s go by parts: I have a combo that brings me the weeks of a month posted. To know how…
-
2
votes3
answers7027
viewsIs Sql Server Agent (SQLEXPRESS) on Local Computer started stopped?
Hello, I have a machine with windows 10 I did the installation of SQL Server normally, it was working, only now SQL Server does not start, I went to the service manager and when trying to boot I…
sql-serverasked 9 years, 2 months ago Harry 3,805 -
2
votes3
answers1053
viewsHow to update with SQL Server count?
I have the following table: Nome | Posicao Item1 | NULL Item2 | NULL Item3 | NULL I’d like her to be like this: Nome | Posicao Item1 | 1 Item2 | 2 Item3 | 3 The ordering criterion is Name…
-
2
votes1
answer53
viewsSQL Server joining tables with null
I have the following tables: Responsavel | Filho Id Nome | Id Nome ResponsavelId 1 Ana | 1 Aninha 1 2 Maria | 2 Ana Júlia 1 3 Pedro | 3 Mariazinha 2 I’d like to make a SELECT with INNER JOIN where…
-
2
votes1
answer1185
viewsDisable date in Datepicker from SQL Server table
I have a system in Classic ASP, in which I have a scheduling calendar. I need to disable the dates that are in the table of holidays and compensations (id_holiday and date). I don’t know how to…
-
2
votes1
answer634
viewsConditional formatting on a gridView
I have a gridView where it’s loaded, from my SQLServer, all bank information. My question is this. can change the color of the source when a date is less than the date of the system (for example,…
-
2
votes3
answers92
viewsError in sql server
No sql como faço para fazer um select com espaço e sem espaços? That is, when I have a pass of the genus '123456' and '123456', the last one with space happens to be done in the query and I have…
-
2
votes3
answers7358
viewsHow to avoid calculation error in SQL Server?
I have an appointment that makes a calculation, plus the field "a. totalcustoproducts" appears with zero value in a few moments, then generates a division error by zero, is it possible to pass some…
-
2
votes1
answer432
viewsView table by foreign key in C#
So, I have a Pizzeria project and I have some tables, such as: Customer Registration, Employee Registration, Order Registration and etc. I’ve already created a Customer and Employees table and…
-
2
votes1
answer746
viewsProblem running runnable JAR: Unable to load class [com.microsoft.sqlserver.jdbc.Sqlserverdriver]
I am facing the following problem: we are in the development phase of a project, which involves the following technologies, SQL Server, Hibernate, Maven, Quartz and java. After finishing one of the…
-
2
votes1
answer7623
viewsGet only first word within a sql server query
Good afternoon to you I have the following query SELECT COUNT (SolID) as quant, UsuNome as gerador FROM Solicitacao INNER JOIN Usuario ON Solicitacao.UsuIDAtendenteViaFone = Usuario.UsuID WHERE…
-
2
votes1
answer1229
viewsEmbedded database with C#
I’m developing a local app for desktop. As there will be no database servers, I studied some, such as Firebird, Sqlite, Access and even Localdb. But I still feel "lost" in which to work. I know the…
-
2
votes1
answer3703
viewsError: Process or Function has Too Many Arguments specified
Criei uma procedure para popular uma grid view: create procedure [dbo].[spc_listaafiliadosadmin] ( @nome varchar(100), @login varchar(100), @cpf varchar(100) ) as begin if(@nome is not null) begin…
-
2
votes1
answer32
viewsSQL Server 2012, doubts
Based on the attached table, could you tell me if the resolution of the exercise below is correct? Show orders that have items that were sold at a discount (discount occurs when the sale price -…
-
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
votes1
answer381
viewsHow do I save the value to decimals before the point in sql server?
I have a field in the bank with this format TESTE numeric(8, 3) I want to record this form. UPDATE TB_PLANO_CONTAS SET TESTE = 001.000 WHERE IDPLANOCONTAS = 63 The result is getting like this: 1,000…
-
2
votes1
answer96
viewsDBGRID does not display result
I have a table that has data registered in SQLServer, but in the application they do not appear in the dbgrid. DATASOURCdo dbgrid -> UDM.DSPecas_ordem_servico When opening the form: procedure…
-
2
votes1
answer114
viewsXML for Database Columns
I have a table that stores an XML in one of its columns, but I need to make a select by placing each XML item in a column. The problem is that I don’t want to create another table, I want something,…
-
2
votes1
answer85
viewsWhat is the best alternative to recording data using a 3G connection?
I have the following situation: a header table with the fields: IDJOGO IDMODALIDADE IDUSUARIO VALOR_JOGADO HORA_JOGO And a detail table: IDJOGO NUMERO_JOGO In this case, it would be feasible to…
-
2
votes1
answer99
viewsXML for temporary table records
Last week I I asked Here on how to place each XML tag in a database column. Now I came across a situation close to that but with a plus, my XML comes from the database, and sometimes will come not…
-
2
votes2
answers907
viewsMount Stored Procedure Dynamic Query in SQL Server
need to mount a conditional query with stored Procedure, to make clear my problem I will expose here to sp with what I want to work, note the end where I use Ifs, this there the problem. USE…
-
2
votes4
answers32475
viewsQuery to catch word after given character
Good morning, I need a way to get all the rest of a string after a certain character, for example, I have the following database I always need to find what’s left of the string after the last "»"…
-
2
votes0
answers110
viewsHow to build a structure from the same structure?
I have much search a way to mount a query in sql server but have not been very successful. First of all, I have a system that controls industrial patio in which there are organizational levels and I…
-
2
votes1
answer1563
viewsHow to sort sql columns in alter table
I have a change to make in the table Inclusão de colunas the doubt is have as I set the order when I am making the change in sql server 2008 ? ALTER TABLE dbo.Arquivos ADD IdTipoDocumento int NULL,…
sql-serverasked 9 years ago Marco Souza 12,304 -
2
votes1
answer94
viewsAuto-update of Publish in Visual Studio zeroing the database
Soon I had to create an installer for desktop application in c#, and as in visual studio 2013 there was Publish that already created Setup and Auto-Update I ended up using it for convenience, but…
-
2
votes1
answer55
viewsSqlserver does not check information correctly in Delphi application
I have a login screen on Delphi + Sqlserver where the goal is to compare the data sent with the data held in the database! first Setting: If I add incorrect password and correct login. shows error!…
-
2
votes1
answer133
viewsData insertion error in Sqlserver + Delphi
I have the following problem, when trying to register a new record in the database it presents me the following error below follows the codes: open the form for registration. procedure…
-
2
votes1
answer1968
viewsViewing Query History in Sql Server Management Studio
I am trying to recover queries I performed in Sql Server Management Studio 2014, I know there is a simple history functionality in Heidi Sql, I wonder if in Sql Server Management Studio 2014 there…
-
2
votes0
answers170
viewsHow can I really integrate my SQL Server with Push on Android?
I have an order table in my SQL Server and an app on Android. Every time an order has a status change, the user receives a notification. I already created the app by GCM from Google, I took the Key…
-
2
votes2
answers156
viewsLogin screen acting incoherent
I set up a login screen where the user must enter login and password with the code below: procedure TFMLogin.Img_confClick(Sender: TObject); var verif: boolean; begin FMHome.ADOLogin.SQL.add('Select…
-
2
votes1
answer37
viewsWhy do update with join does not obey the WHERE conditional
I will replace the values of a column in table A by values in table B, being conditioned by a column in table C. When doing UPDATE, the condition is not being respected and all values are being…
sql-serverasked 8 years, 9 months ago Marcelo de Andrade 7,261 -
2
votes2
answers10301
viewsHow to give a SELECT in multiple databases at once?
I have several databases on my server and I need to perform a query to return some information from a table that exists in all these other databases. How can I make a SELECT on several bases at the…
-
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
votes1
answer70
viewsSelect checking a condition
I need to make a select where a condition is checked. Ex: If the value of a given field is < 0 assign the sum of that field to column "PerdaGerada" otherwise assign the column "LucroGerado".…
-
2
votes3
answers1432
viewsPerform UPDATE with values from another table, in columns with the same name
I have the following tables table and table, These tables have about 20 identical columns. What I need to do is update the values of the tabela_B to start from the tabela_A, where the columns are…
sql-serverasked 8 years, 9 months ago Marcelo de Andrade 7,261 -
2
votes2
answers531
viewsOrganize columns in rows for equal ID in SQL server
I have a single table with some key records(Foreign key) repeated at most 5 times according to entries, example: id_ok|fornecedor|valor_final|escolha|ativo|…
-
2
votes1
answer900
viewsHow to traverse lines of a SELECT in a STORED PROCEDURE in SQL Server?
Other than with the use of CURSOR and WHILE in the SQL Server, what other ways it would be possible to traverse the result lines of a SELECT in a STORED PROCEDURE?…
-
2
votes3
answers756
viewsHow to group results in a row?
I would like to perform a query About the table FICHA_EXAME with the following data: CREATE TABLE FICHA_EXAME ( FICHA smallint, EXAME VARCHAR(15) ); INSERT INTO FICHA_EXAME VALUES (1,'Hemograma');…
-
2
votes1
answer1343
viewsError when connecting SQL server
Hello, I downloaded SQL Server Express 2014 with tools from Microsoft site. I did the installation but when I will start the error Error description: TITLE: Connect to Server…
sql-serverasked 8 years, 11 months ago WSS 1,326 -
2
votes1
answer344
viewsInsert/update with values from other tables
I have this bd. I want to do an Insert/update the table misses_licao. But I don’t have any id, just the numbers and names. How do I make an Insert/update to relate to another table? Dim sql As…
-
2
votes2
answers2254
viewsIs it possible to know where an sql execution originated in SQL SERVER?
There is a situation that I believe will be of great importance to me, which is to know the origin of an sql command in SQL SERVER. Suppose that accidentally a user has executed any command. Then I…