SQL Window Functions Series: LAG() and LEAD()
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
7,281 reads
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
7,281 reads
2023-11-27
5,475 reads
Profiler is a GUI based tool that runs a SQL Server trace to capture the metrics listed above as well additional data. This data can then be used to determine where your SQL Server performance issues are related to your TSQL code. Running a trace without using Profiler is known as a Server Side Trace. You can create and start the trace using TSQL commands instead of having to use the GUI.
2023-09-29
A query is sometimes super fast and sometimes very slow. One of the main reasons for this problem is Parameter Sniffing. There are several approaches to addressing the Parameter Sniffing issue and this article discusses effective methods for handling Parameter Sniffing in SELECT statements containing a TOP clause.
2023-09-18
In this tip, we will discuss the process of generating test data to verify query logic without relying on real-life data, along with some helpful guidelines. We will also cover various scenarios and their corresponding solutions.
2023-09-15
There is more than one way to work with SQL Server stored procedures from within a .NET Application. However, when using parameters, in order to avoid exposing your code to "SQL Injection" vulnerabilities, there is a certain way based on which you should write your code.
2023-08-21
RDS Custom for SQL Server recently released exciting new features related to Bring Your Own Media (BYOM) and High Availability. By using BYOM, customers may leverage their existing SQL Server licenses with Amazon RDS Custom for SQL Server, when used in accordance to Microsoft terms. This allows customers who have already purchased SQL Server licenses to save on TCO/license costs, while offloading the undifferentiated heavy lifting of database management to Amazon RDS Custom. By using Multi-AZ deployment, customers can now set up high availability for their databases.
2023-08-14
Sometimes, we need to find the first or last n% records from a dataset based on a particular column. For instance, a teacher wants to know which students are in the bottom 25% based on marks. Hence, in such situations, the SQL NTILE() function helps. We will leverage this tip to get first or last n% records using NTILE() in SQL Server.
2023-08-04
I have come across a lot of use cases for manufacturing rows on the fly, aside from the common goal of populating a large data set such as a numbers or calendar table. A few favorites include building sample data, pivoting an unknown number of columns, data extrapolation, and filling gaps in date or time ranges.
2023-07-26
In this article, learn how to query cached query statistics and execution plans for Oracle or SQL Server to identify code that can be optimized to improve performance.
2023-07-21
By Kevin3NF
Everything in SQL Server is waiting for something…this is by design. And most people...
By DataOnWheels
Hey fellow data friends! Wow, March was an absolutely crazy month (in the best...
We value your privacy. This policy explains what personal data we collect and why. What...
Hey everyone, I'm trying to access an XML file download from a government website...
Hi, I have very large table (6 * 10^9 records) where i have 4...
What types of sources can be used with the Import Flat File Wizard in SQL Server Management Studio (SSMS)?
See possible answers