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
-
-1
votes1
answer148
viewsComponents for Integration Services - SSIS - Data Flow
Hello! I have a need to develop a component for Integration Services (SSIS) -> Data Flow. I already have components developed for the Control Flow area, but I have never developed anything for…
-
-1
votes2
answers663
viewsInsert an html into a table using sql server
How could an Insert in a table of an HTML code? Example: insert into TB_CONTEUDO (CONT_TITULO, CONT_HTML, CONT_COCA_FK_ID, CONT_META_TAG) values('Teste','',17,'') CONT_HTML = html one-page…
sql-serverasked 7 years, 5 months ago Harry 3,805 -
-1
votes1
answer1648
viewsHow to refer to Assembly in Visual Studio?
I was trying to create an application that connects with a database. But the methods of SqlConnection.Open(), SqlConnection.State and SqlConnection.Close() are with errors all appear the message:…
-
-1
votes1
answer708
viewsHow to know how many sales for each month?
I need to set up a query that brings the total sales of each month from a table called sales.SalesOrderHeader, but I’m not getting it. In this table there is a field OrderDate which is the date of…
-
-1
votes1
answer30
viewsDelete period without tag Between
Good afternoon, Is there any way to delete a period without using the BETWEEN? x NOT BETWEEN HorFim AND HorIni and y NOT BETWEEN HorFim AND HorIni Where: x = hora inicial digita pelo usuario. y =…
-
-1
votes2
answers1046
viewsHow to Save Date, Time, Minute, and Second in C# WINFORMS and SQL SERVER?
I created a sales system, and I need you to record the date, time, minutes and seconds. The way I did, it only records the date, and the rest comes 00:00. Below is the code of what I did: //evento…
-
-1
votes1
answer208
viewsWrite to BD without mask applied by jQuery
I am doing a project in MVC and with the use of jQuery I made CPF mask as below: $(document).ready(function() { $(".cpf").mask("999.999.999-99"); $(".cpf").addClass("form-control"); }); Follow my…
-
-1
votes1
answer76
viewsselect data from a sql server database in C#
I made a precedent that takes all the data from all the columns of my sql table of interest, in my Asp application in c# I can put all the rows in a list ,but I need to refine this search by taking…
-
-1
votes1
answer33
viewsDate choices
Good afternoon, you guys, I’m looking to make a iif in sql that if the field FLAG is equal to "And" it brings the date of the column DTDIGIT and store in variable @dataInicio, and when the FLAG for…
sql-serverasked 6 years, 10 months ago Leonardo Palmieri 71 -
-1
votes1
answer68
viewsList of DB clients on the program page in C#
My problem is this, I do not know how to make appear on the user screen a list with limit X of clients of a DB, I will try to put in topics for a better understanding 1 - The customer list should…
-
-1
votes1
answer154
viewsType varbinary sql server attribute with c#
That column DocumentoPDF until now it was not used by the: I mean I was always null, however at some point added values and then error occurred in my query linq and the problem is that at the moment…
-
-1
votes1
answer39
viewsHow can I make an if if Database data is True or False
How can I make an if by checking whether the data of a column in the Database table is True or False? For example: using (SqlCommand cmd = new SqlCommand($"SELECT LoginID,Award FROM…
-
-1
votes3
answers73
viewsHow do I select the latest records for specific entries?
I have a table with customer purchase records, I would like to select only the last purchase of each customer. How to do this? I tried to use DISTINCT, but I have other data I need and are not…
sql-serverasked 6 years, 7 months ago Fernando Fragoso 35 -
-1
votes1
answer535
viewsRelational Order Tables in C#
Good morning Guys, I am developing an order screen where will be added products to compose the request, but I can not imagine a way to save the order items in a table, how could relate the product…
-
-1
votes1
answer48
viewsUpdate by value difference per id
I am trying to perform an update through this select, where I see what are different data from the pen_registration table, but when trying to perform an update, it presents errors: [MYSQL] UPDATE:…
-
-1
votes1
answer77
viewsFetch last recorded date in sql cpf_cnpj
I have a basis that I need one of the columns to be the search for the lowest date recorded on that CPF/CNPJ in the base. In the example would create the column data_anterior: cpf_cnpj | aplicado|…
-
-1
votes1
answer2686
viewsHow to make a SE function in SQL
Good morning. How do I make a SE function in SQL server? For example, I have data in a column and when it is = '1';'masculino';'feminino'. You can help me please?
-
-1
votes2
answers22
viewsNew procedure is not displayed in SQLSERVER
Follow the steps in doc in microsoft: https://docs.microsoft.com/pt-br/sql/relational-databases/stored-procedures/create-a-stored-procedure?view=sql-server-2017#SSMSProcedure I changed the…
-
-1
votes2
answers751
viewsMaximum size, connection limit and which version of SQL Server should I use in my desktop application
I am developing a system and I am using SQL Server 2014 database, but free. Which version can I use so that I don’t limit my bank’s resources when I reach a larger size or exceed a number of…
sql-serverasked 6 years, 4 months ago Rafa 178 -
-1
votes3
answers885
viewsSQL server connection with angular 4 +
I would like to know how to make a connection to the SQL server database through Angular 4. I needed to know the procedures or an explanatory video. I’m a beginner in angular.
-
-1
votes1
answer459
viewsExternal connection to sql server by android application, C# xamarim
Good I am in search of information regarding which procedure to access a sql server database by android.
-
-1
votes1
answer35
viewsHow to put zeros after type checker - sql server
I need to put 9 zeros after 02: 0207200000053P 02- here comes the zeroes - 07200000053P that is coming from a variable called @vNossoNumero. How do I do that? Variable Select @vNossoNumero = case…
-
-1
votes1
answer43
viewsConversion of Procedures
Does anyone know or know an easy but easy way to migrate stored-procedures from SQL-Server to Oracle.
-
-1
votes1
answer399
viewsImport SSIS file with columns at different positions each day
I have the following situation: I make a Flat File (Simple File) import from a *.CSV file to a table in the database. Using SSIS in Visual Studio. However, each day the file I receive has the order…
-
-1
votes1
answer1246
viewsSql server convert String time to Decimal
Guys I’m having a question of how to convert a column string that brings the time like '08:00:00' to decimal, just like Excel does, when it changes the format to number for example: '08:00:00' =…
-
-1
votes1
answer3233
viewsTake only the value and format in 2 decimal places
Well, I have a python script that queries two different databases to verify values per day, one in SQLSERVER and the other in Postgres. I used an if to warn if the values were different and if it…
-
-1
votes1
answer89
viewsGet last sql server information from netbeans jdbc
I am using this way to try to bring the latest information registered in sql server, but for some unknown reason it is not working. I searched in several forum and apparently is used the same method…
-
-1
votes1
answer111
viewsMigration oracle to sql server
Can anyone indicate me a good data migration tool for the oracle database to the sql server database and vice versa? I need to take a lot of records from the oracle database and save it in the sql…
-
-1
votes1
answer295
viewsCheckbox
I’m having trouble creating a web page where I have select boxes dependent on it. For example, after selecting the first box the values of the second one vary according to the selected option. The…
-
-1
votes1
answer64
viewsActive backup or Restore
Today when making an Insert in a table the message was presented: The transaction log for database "database name" is full due to "ACTIVE BACKUP OR RESTORE". What is the reason for this message?…
sql-serverasked 5 years, 9 months ago user139523 1 -
-1
votes2
answers4491
viewsQuery Search Specific Word in a Field - SQL Server
Is there a function that I can only find the data of a field ? I’m only trying to get from Expiration until 2019, I have several lines with this validity information, and they don’t appear in the…
-
-1
votes2
answers1108
viewsCommand to set a default value for a column in SQL Server
Hello, I want to know the command to set a value like default in SQL server. The table name is "Table" and the column name you want to change is "COLUNA2".
-
-1
votes1
answer381
viewsHow to check null fields in sql?
The Trigger I have to do: A user can only classify an offer if he has purchased it (reservation with estado = pago). On the other hand one of the two attributes classification and comment has to be…
-
-1
votes1
answer398
viewsAdd multidimensional array as an array item
I am working with Windows and I am implementing a permissions-based menu, I am recovering the menu data from a table in my database. I created a model and in it I am doing the logic to retrieve the…
-
-1
votes1
answer85
viewsSubconsulta SQL
I’m doing the consultation below: select idtce from tab_tce where idempresa = 2493 and YEAR(dt_inicial) = 2018 and idtce not in( select TCE_ID from SEC_VAGA_ESTUDANTE ) But returns this error: Msg…
-
-1
votes1
answer36
viewsTable with default value not loaded
I created a table GrupoDesconto, with three fields: Id, Descricao and MargemDesc. On the table Revenda, created a foreign key (Foreign key) GrupoDescontoId who receives the id of GrupoDesconto and…
-
-1
votes2
answers97
viewsLEFT JOIN com having
If I have to use a grouping that involves a field of my table that is related through LEFT JOIN and need to use HAVING, how would it look? I know that in WHERE I can not put because ignores LEFT and…
-
-1
votes1
answer86
viewsSQL return relationship data on the same line
When carrying out the consultation SELECT [Product_Id] ,[ProductTag_Id] FROM [Product_ProductTag_Mapping] I have the result I need Saida to be:…
-
-1
votes3
answers37
viewsList of vehicles that are without photos
I need the list of vehicles that do not have registered photos. I have a Vehicles table, an Image table and another Type. Example: tbVeiculo (VeiculoId, DataCadastro, Etc...) tbImagemVeiculo…
-
-1
votes1
answer42
viewsinsert xml record plus date into a time table
I wanted to make this select but I can’t > DECLARE @XML XML > SET @XML = > '<rows> <row> <tracking> JU148345357BR</tracking> </row> <row>…
-
-1
votes1
answer216
viewsImport CSV into SQL Server
I tried to import a database using csv to a ready-made sql server base that we have deployed to other companies. But in the system when registering, a client for example, uses MAX(ID)+1 to generate…
-
-1
votes2
answers74
viewsView.Bag returning null
I am creating an APS.NET CORE form with C# and Sqlserver sending email and one of the fields is a dropdownlist that lists data from a table. List<Templates> templates = new…
-
-1
votes1
answer213
viewsHow often a string appears in a table in each record (SQL Server)
I have a table in SQL with a column called "content", varchar . This column stores the contents of Xmls. I need to count the number of times a certain word (tag) is in each XML, ie for each record…
-
-1
votes1
answer106
viewsPlace only two decimal places in a sqlServer sum function
I would like to know how to put only two decimal places in the field of the sum.…
sql-serverasked 4 years, 6 months ago Matheus Lima Fraga 27 -
-1
votes1
answer85
viewsUsing the DATEDIFF
Guys, how do I make a condition with DATEDIFF deletes data from a table in 12 in 12 months? Example: You are in June 2020 - Then it erases everything before 01/06/2019. Another example: You are in…
-
-1
votes1
answer59
viewsMy Spring Data Hibernate project does not create the tables in SQL Server
I am studying Spring Data with Hibernate and I am using the SQL server database. I set up the project, with the dependencies in the pom file. The project is complicated without errors, but does not…
-
-1
votes1
answer25
viewsoperation with date and deadlines SQL_SERVER
I have a table in the comic book that has a column called term. in that column I have the deadline information in months ex.: 10, 6, 12, 14.... i would need to calculate to know the final date of…
-
-1
votes2
answers44
viewsImprove select SQL Server performance
I have a table with 2 million records and I need to take 1000 by 1000, I know I can use TOP, but use the form below pq need to control the quantity, example: I get 1000 after the next 1000, then the…
-
-1
votes1
answer23
viewsHow to search records until the previous month?
I need to get all the data, from the beginning to the previous month, this query has to be dynamic, I can not put a fixed date, because next month we need to consult again... In summary, today I…
-
-1
votes1
answer67
viewsHow to concatenate a result of a case with other fields?
Example: select x+y+ case when 2>1 then 'z' else 'w' end from table Expected result: Xyz The code above results in error. I couldn’t find anything like it... Admitting that they are all fields of…