Category Archives: SqlServer

Remove duplicates with less null values

Questions: I have a table of employees which contains about 25 columns. Right now there are a lot of duplicates and I would like to try and get rid of some of these duplicates. First, I want to find the duplicates by looking for multiple records that have the same values in first name, last… Read More »

SQL71501 – How to get rid of this error?

Questions: We’re using two schemas in our project (dbo + kal). When we are trying to create a view with the following SQL statement, Visual Studio shows as an error in the error list. CREATE VIEW [dbo].[RechenketteFuerAbkommenOderLieferantenView] AS SELECT r.Id as RechenkettenId, r.AbkommenId, r.LieferantId, rTerm.GueltigVon, rTerm.GueltigBis, rs.Bezeichnung, rs.As400Name FROM [kal].[Rechenkette] r JOIN [kal].[RechenketteTerm] rTerm ON… Read More »

SQL Server Rolls back my transaction when using THROW

Questions: I have an INSERT trigger on one of my tables that issues a THROW when it finds a duplicate. Problem is my transactions seem to be implicitly rolled back at this point – this is a problem, I want to control when transactions are rolled back. The issue can be re-created with this script:… Read More »

Hangfire keeps running SQL queries even when inactive

Questions: I’m developing an ASP.net MVC 5 web site and I’m using Hangfire for scheduling some tasks, in this case just one every 3 min. I know for a fact that it takes only a few seconds to run such task (and the DB query associated with it). The problem I’m facing is that it… Read More »

Select data from three table in sql

Questions: I have three table Like Student : Sid, SName, SEmail Fees_Type : Fid, FName, FPrice StudentFees : Sid(FK from Student),Fid(FK from Fees_Type), FDate Data of Each Table : Student : SID |SName | SEmail 1 | ABC | ABC@www.com 2 | XYZ | xyz@www.com Fees_Type: Fid | FName | FPrice 1 | Chess |… Read More »