We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ErikEJ/SqlServer.Rules'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
SML025.md•1.18 KiB
# SQL Server Rule: SML025
| | |
|----|----|
| Assembly | TSQLSmellSCA |
| Namespace | TSQLSmellSCA |
| Class | TSQLSmellSCA25 |
## Rule Information
| | |
|----|----|
| Id | SML025 |
| Friendly Name | RANGE windows are much slower then ROWS (Explicit use) |
| Category | CodeSmells |
| Ignorable | false |
| Applicable Types | Model |
## Description
RANGE windows are much slower then ROWS (Explicit use)
### Examples
```sql
Create Procedure dbo.ExplicitRangeWindow
as
SET NOCOUNT ON;
/* Default is Range UNBOUNDED PRECEDING ( Defining the frame )*/
select sum(TestTableSSDT.IdCol) over(partition by TestTableSSDT.Col1
order by TestTableSSDT.Col2
Range UNBOUNDED PRECEDING) as RollingBalance
from [dbo].[TestTableSSDT]
order by Col1,Col2;
-- SML025
```
```sql
/* Default is Range UNBOUNDED PRECEDING ( Defining the frame )*/
Create Procedure dbo.RangeWindow
as
set nocount on
select sum(IdCol) over(partition by Col1
order by Col2
Range UNBOUNDED PRECEDING) as RollingBalance
from dbo.TestTableSSDT
order by Col1,Col2;
-- SML025
```
<sub><sup>Generated by a tool</sup></sub>