How to pass parameters to view in sql server 2008? You can’t pass parameters directly to a view in SQL Server 2008 like you do with a stored procedure. Instead, you filter data in a view using WHERE clauses that reference session or user context, or you wrap the view in a parameterized query in your application or a stored procedure. In this guide, you’ll learn practical patterns to simulate parameterized views, with examples, performance tips, and best practices.
How to pass parameters to view in sql server 2008 is a common challenge for developers who want reusable, readable queries without hardcoding values. Quick fact: you can’t pass parameters to a view directly, but you can achieve similar results with clever techniques. This article shows you:
- Practical patterns to emulate parameterized views
- How to use functions, inline table-valued functions, and stored procedures for parameterization
- Performance considerations and common pitfalls
- Step-by-step examples you can apply right away
- Real-world tips to keep queries fast and maintainable
Useful URLs and Resources text only
SqlServer Tutorials – sqlserver-tutorials.com
Microsoft Docs – docs.microsoft.com
Stack Overflow – stackoverflow.com
SQL Server Central – sqlservercentral.com
SQL Performance – sqlperformance.com
SQL Server 2008 Books Online – not clickable msdn.microsoft.com
T-SQL Guide – sqlcat.com
Understanding the Limitation: Views vs. Parameters
- Views are virtual tables defined by a query. They don’t accept parameters directly.
- If you need dynamic filtering, you typically filter against the view in a SELECT statement or wrap the view in a stored procedure or inline function.
Quick recap
- Direct parameter passing to a view: not possible in SQL Server 2008.
- Workarounds: parameterized queries against the view, inline functions, or dedicated stored procedures.
Common Techniques to Simulate Parameterized Views
1 Use a Parameterized SELECT Against the View
You pass values in the WHERE clause when querying the view.
Example:
SELECT v.*
FROM dbo.SalesView AS v
WHERE v.SaleDate BETWEEN @StartDate AND @EndDate
AND v.Region = @Region;
- Pros: Simple, no extra objects needed.
- Cons: Must be done every time you query; not reusable for multiple parameters in one call.
2 Inline Table-Valued Function TVF as a Parameterizable Wrapper
Create an inline TVF that returns the same data as your view but accepts parameters.
Example:
CREATE FUNCTION dbo.fn_SalesByDateRegion@StartDate DATE, @EndDate DATE, @Region NVARCHAR50
RETURNS TABLE
AS
RETURN
SELECT *
FROM dbo.SalesView
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;
Usage:
SELECT *
FROM dbo.fn_SalesByDateRegion’2024-01-01′, ‘2024-12-31’, ‘North’; How to open a port in windows server 2026 firewall: Inbound rules, ports, and security best practices
- Pros: Reusable, clean, can be composed in larger queries.
- Cons: Slightly more objects to maintain.
3 Use a Multi-Statement Table-Valued Function MSTVF
If you need more complex logic, MSTVF allows multiple statements but has performance caveats.
Example:
CREATE FUNCTION dbo.fn_SalesByDateRegion_MSTVF@StartDate DATE, @EndDate DATE, @Region NVARCHAR50
RETURNS @Result TABLE SaleID INT, SaleDate DATE, Amount DECIMAL12,2, Region NVARCHAR50
AS
BEGIN
INSERT INTO @Result
SELECT SaleID, SaleDate, Amount, Region
FROM dbo.SalesView
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;
RETURN;
END;
Usage:
SELECT *
FROM dbo.fn_SalesByDateRegion_MSTVF’2024-01-01′,’2024-12-31′,’South’;
- Pros: Flexible for complex logic.
- Cons: Potentially slower; inline TVFs generally perform better.
4 Create a Stored Procedure That Returns a Result Set
Wrap the view logic in a stored procedure and pass parameters. How to Name Query a Specific DNS Server: DNS Query Targeting, DNS Server Selection, Dig NSLookup Examples 2026
Example:
CREATE PROCEDURE dbo.usp_SalesByDateRegion
@StartDate DATE,
@EndDate DATE,
@Region NVARCHAR50 = NULL
AS
BEGIN
SET NOCOUNT ON;
SELECT *
FROM dbo.SalesView
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;
END;
Usage:
EXEC dbo.usp_SalesByDateRegion ‘2024-01-01’, ‘2024-12-31’, ‘West’;
- Pros: Clear parameter interface, good for access control and batching.
- Cons: Not a drop-in replacement for a view; separate object.
5 Use a Scalar Function for Contextual Filtering with caution
If you need to derive a value used in filtering, a scalar function can help, but be mindful of performance and row-by-row evaluation.
Example not recommended for large datasets:
CREATE FUNCTION dbo.fn_UserPreferredRegion@UserID INT
RETURNS NVARCHAR50
AS
BEGIN
DECLARE @Region NVARCHAR50;
SELECT TOP 1 @Region = Region FROM UserPreferences WHERE UserID = @UserID;
RETURN @Region;
END;
Usage:
SELECT *
FROM dbo.SalesView
WHERE Region = dbo.fn_UserPreferredRegion@CurrentUserID; How to Mute Someone in a Discord Server A Step by Step Guide 2026
- Pros: Centralizes business rules.
- Cons: Scalar functions can slow queries due to RQ/EVAL; use with care.
Performance Considerations
- Parameter sniffing: SQL Server may optimize plans based on the first parameter values. Use OPTIONRECOMPILE judiciously or parameterize with local variables inside procedures to avoid sniffing issues.
- Indexing strategy: Ensure the underlying view’s base tables have proper indexes on the filtered columns e.g., SaleDate, Region.
- Statistics: Keep statistics up to date, especially if data distribution changes with date ranges.
- SARGability: Keep predicates simple and SARGable Search ARGumentable to leverage indexes.
- View vs. TVF performance: Inline TVFs often perform closer to views because they don’t spill into a temporary table; MSTVF can be slower due to materialization.
- Computed columns and functions: Avoid heavy computations inside the view when possible; move logic to the caller or precompute.
Practical Example: Real-World Scenario
Business need: Retrieve sales data for a given date range and region, with the ability to fetch all regions when no region is specified.
Step-by-step approach:
- Create the base view if not already exists.
Example:
CREATE VIEW dbo.vw_Sales
AS
SELECT SaleID, SaleDate, Amount, Region
FROM dbo.Sales
WHERE IsActive = 1;
- Option A: Simple parameterized query against the view
DECLARE @StartDate DATE = ‘2024-01-01’;
DECLARE @EndDate DATE = ‘2024-12-31’;
DECLARE @Region NVARCHAR50 = NULL; — null means all regions
SELECT *
FROM dbo.vw_Sales
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;
- Option B: Inline TVF for clean reuse
CREATE FUNCTION dbo.fn_SalesByDateRegion@StartDate DATE, @EndDate DATE, @Region NVARCHAR50
RETURNS TABLE
AS
RETURN
SELECT SaleID, SaleDate, Amount, Region
FROM dbo.vw_Sales
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;
Usage:
SELECT * FROM dbo.fn_SalesByDateRegion’2024-01-01′,’2024-12-31′,’EU’; How to Open SQL Server in Visual Studio 2017 A Step by Step Guide: Connect, LocalDB, SSDT 2026
- Option C: Stored Procedure for batch processes
CREATE PROCEDURE dbo.usp_GetSalesByDateAndRegion
@StartDate DATE,
@EndDate DATE,
@Region NVARCHAR50 = NULL
AS
BEGIN
SET NOCOUNT ON;
SELECT SaleID, SaleDate, Amount, Region
FROM dbo.vw_Sales
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;
END;
EXEC dbo.usp_GetSalesByDateAndRegion ‘2024-01-01′,’2024-12-31′,’EU’;
Field Guide: When to Use Each Approach
- Quick ad-hoc filtering: Simple parameterized SELECT against the view.
- Reusability and composing queries: Inline TVF is a strong choice.
- Centralized logic and batch jobs: Stored procedures shine.
- Complex business rules: MSTVF can handle non-trivial transformations, but test performance.
Best Practices for Maintenance
- Keep views focused: A view should encapsulate a coherent subset of data, not business rules.
- Favor inline TVFs for parameterized patterns: They’re typically easier to optimize.
- Document parameter expectations: Use comments in functions and procedures to explain parameter meaning and default values.
- Avoid over-abstracting: Don’t create too many wrappers; maintain a balance between readability and performance.
- Regularly audit query plans: Look for scans that could be converted to seeks with proper indexing.
Real-World Tips for Developers
- If you’re building an application, prefer passing parameters to a stored procedure that queries a view, instead of a view directly.
- Use parameter defaults sparingly; defaults can mask performance issues if not well designed.
- Test with realistic data volumes: Small datasets behave differently from production sizes.
- Consider partitioning for large date-based datasets to improve performance.
Quick Reference: Snippets You Can Copy
-
Simple parameterized query against a view
SELECT *
FROM dbo.vw_Sales
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL; -
Inline TVF for date and region filtering
CREATE FUNCTION dbo.fn_SalesByDateRegion@StartDate DATE, @EndDate DATE, @Region NVARCHAR50
RETURNS TABLE
AS
RETURN
SELECT SaleID, SaleDate, Amount, Region
FROM dbo.vw_Sales
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;— Usage
SELECT * FROM dbo.fn_SalesByDateRegion’2024-01-01′,’2024-12-31′,’North’; -
Stored Procedure wrapper
CREATE PROCEDURE dbo.usp_GetSalesByDateAndRegion
@StartDate DATE,
@EndDate DATE,
@Region NVARCHAR50 = NULL
AS
BEGIN
SET NOCOUNT ON;
SELECT SaleID, SaleDate, Amount, Region
FROM dbo.vw_Sales
WHERE SaleDate BETWEEN @StartDate AND @EndDate
AND Region = @Region OR @Region IS NULL;
END; How to protect a Discord server from raids: the ultimate guide 2026— Execution
EXEC dbo.usp_GetSalesByDateAndRegion ‘2024-01-01′,’2024-12-31′,’EU’;
Frequently Asked Questions
How to pass parameters to view in sql server 2008?
Direct parameter passing to a view isn’t supported. Use a parameterized query against the view, an inline TVF, or a stored procedure to achieve dynamic filtering.
Can I pass multiple parameters to a view?
Not directly. You can filter using a WHERE clause that references your parameters in the calling query, or wrap the view with a TVF or stored procedure that accepts multiple parameters.
Why use a TVF instead of a stored procedure?
TVFs can be used inline in larger queries and often optimize better with the query optimizer, providing reusable parameterized results.
What is an inline table-valued function?
An inline TVF returns a table defined by a single SELECT statement, making it efficient and easy to compose with other queries. How to Mask SSN Data in SQL Server: Dynamic Data Masking, Encryption, and Best Practices 2026
What is parameter sniffing and how do I avoid it?
Parameter sniffing is when SQL Server uses the first parameter values to compile an execution plan. If this causes suboptimal plans, use OPTIONRECOMPILE or local variables within procedures to mitigate.
How do I optimize performance when filtering by date ranges?
Ensure proper indexing on date columns, keep predicates SARGable, update statistics, and consider partitioning large tables for date-based data.
Should I use NULL to indicate “all” in filters?
Using NULL as a default to indicate all can simplify logic, but ensure you explicitly handle NULL in your predicates.
What is the difference between an inline TVF and a multi-statement TVF?
Inline TVFs are single SELECT statements; they usually perform better. MSTVFs can contain multiple statements but may incur slower performance due to materialization.
Is it safe to use scalar functions for filtering?
Scalar functions can slow queries because they execute per row. Prefer inline logic, or avoid scalar functions in predicates on large datasets. How to Make Bots in Discord Server a Step by Step Guide: Build, Deploy, and Manage Your First Discord Bot 2026
How do I choose the right approach for my project?
Consider ease of use, performance, maintenance, and how you plan to reuse the logic. Inline TVFs are often a good balance for parameterized needs.
You can’t pass parameters to a view directly in SQL Server 2008. This guide covers why that is, plus practical alternatives like inline table-valued functions ITVFs, stored procedures, and best practices to keep your queries fast and maintainable. You’ll learn a step-by-step approach to implement parameterized data access, how to choose between ITVFs and stored procedures, performance considerations, and real-world usage examples.
Useful URLs and Resources unclickable
- Microsoft Docs – Inline Table-Valued Functions ITVF in SQL Server
- Microsoft Docs – Create Function Transact-SQL
- SQL Server 2008 Books Online – Views and Functions
- Stack Overflow discussions on parameterized views and table-valued functions
- MSDN blog posts on CROSS APPLY and table-valued functions
Introduction summary
You can’t pass parameters to a view in SQL Server 2008. Instead, use an inline table-valued function ITVF to simulate a parameterized view, or switch to a stored procedure when you need to return a specific result set. This post walks you through the concepts, demonstrates a clean ITVF approach, shows how to use CROSS APPLY for complex filtering, and compares when to use each pattern. It also includes tips for performance, security, and potential upgrade paths. If you’re after practical, actionable steps, you’ll find concrete code you can adapt today.
Why a view can’t take parameters in SQL Server 2008
- Views are stored SELECT statements that behave like saved queries. They don’t accept input parameters, so you can’t filter a view by a dynamic value supplied by an application or user session.
- If you try to pass a parameter to a view, you’ll end up with either a static result no filtering or a workaround that often harms performance and readability.
- The common workarounds like concatenating values into dynamic SQL or relying on session context tricks introduce security risks SQL injection or maintenance headaches.
In practice, the most robust approaches are ITVFs and stored procedures, both of which let you supply parameters safely and efficiently. How to manage dns server 2012 a step by step guide 2026
Inline table-valued functions ITVF as parameterized views
- ITVFs are functions that return a table and can accept parameters. They behave like parameterized views in usage, but with a defined input signature.
- They’re compiled as part of the query plan, which often yields good performance, especially when you enable proper indexing on the underlying tables.
- ITVFs allow you to keep your data access logic centralized and reusable, while still letting you filter by user-provided values.
Key points to remember:
- ITVFs return a table, so you can SELECT from them just like you would from a view.
- They support parameters, so you can filter by any criteria you need date ranges, IDs, status, region, etc..
- Use WITH SCHEMABINDING to improve reliability and potential optimizations.
Step-by-step: Create and use an ITVF with parameters
Step 1: Create a parameterized ITVF
-- Example: Get recent orders by a specific customer
CREATE FUNCTION dbo.GetRecentOrdersByCustomer
@CustomerID INT,
@FromDate DATETIME
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN
SELECT o.OrderID,
o.OrderDate,
o.TotalAmount,
o.CustomerID
FROM dbo.Orders AS o
WHERE o.CustomerID = @CustomerID
AND o.OrderDate >= @FromDate
;
GO
Step 2: Use the ITVF in a query
SELECT *
FROM dbo.GetRecentOrdersByCustomer12345, '2024-01-01';
Tips:
- Include relevant columns and consider adding a covering index on OrdersCustomerID, OrderDate to improve performance.
- If your filter uses nullable parameters, design the function to handle NULLs gracefully e.g., return all records when a parameter is NULL.
Step 3: Optional optimization with SCHEMABINDING How to mark a discord server as nsfw: Channel NSFW, Age-Restricted, and Server Settings for Safe, Compliant Communities 2026
- SCHEMABINDING ensures the underlying tables’ schema can’t be changed in ways that would break the function, which sometimes helps the optimizer.
- You’ll need to reference fully qualified object names when SCHEMABINDING is used.
How to use ITVF with CROSS APPLY
- CROSS APPLY lets you pass parameters and join the results of a table-valued function to each row of a table, enabling more complex filtering and dynamic coupling.
- This approach is useful when you want to apply a parameterized filter based on some outer query value.
Example:
DECLARE @CustomerID INT = 12345;
DECLARE @FromDate DATETIME = '2024-01-01';
SELECT o.OrderID, o.OrderDate, o.TotalAmount
FROM dbo.Orders AS o
CROSS APPLY dbo.GetRecentOrdersByCustomero.CustomerID, @FromDate AS f
WHERE o.CustomerID = @CustomerID;
Notes:
- This pattern can be handy when you’re composing a more dynamic query where the outer query determines some inputs for the inner dataset.
- In many scenarios, calling the ITVF directly as in the previous section is simpler and clearer. CROSS APPLY shines when you need to combine multiple data sources or perform per-row logic that depends on both sides.
Alternative: Stored procedures for parameterized data retrieval
- When your goal is to return a specific result set with parameters, a stored procedure is a natural choice.
- Pros: clear parameter handling, flexible output, easy to grant permissions on a per-procedure basis.
- Cons: result sets produced by stored procedures aren’t directly joinable like views; they’re best used as standalone data sources or fed into reporting tools.
Example:
CREATE PROCEDURE dbo.usp_GetOrdersByCustomer
@CustomerID INT,
@FromDate DATETIME
AS
BEGIN
SET NOCOUNT ON;
SELECT OrderID,
OrderDate,
TotalAmount,
CustomerID
FROM dbo.Orders
WHERE CustomerID = @CustomerID
AND OrderDate >= @FromDate
ORDER BY OrderDate DESC;
END
GO
Usage:
EXEC dbo.usp_GetOrdersByCustomer @CustomerID = 12345, @FromDate = '2024-01-01';
When to choose a stored procedure over an ITVF: How to log errors in sql server stored procedures 2026
- You need to return multiple result sets or perform procedural logic beyond a single SELECT.
- You want more explicit control over execution plans and error handling.
- You’re building an API layer or service where the function’s single-branch result-set approach isn’t sufficient.
Performance considerations and best practices
- Prefer ITVFs over dynamic SQL in views for better maintainability and safety. ITVFs behave like views but with parameters, and inline TVFs are generally fast because they get optimized similar to a simple SELECT.
- Use appropriate indexing:
- On Orders: a nonclustered index on CustomerID, OrderDate can dramatically improve the performance of parameterized filters.
- Beware of scalar UDFs inside a SELECT; in SQL Server 2008, scalar UDFs can degrade performance due to row-by-row execution. Keep logic in the ITVF or use direct joins instead.
- Parameter sniffing can cause plan mismatches. If you notice plan instability, consider:
- OPTION RECOMPILE on critical queries to generate a per-execution plan, or
- Local variables inside larger dynamic queries to avoid sniffing on the initial parameter values.
- Security: grant users SELECT rights on the ITVF or the underlying tables as appropriate. Using SCHEMABINDING can also help with stability.
- Testing: compare performance of the ITVF approach against a stored procedure for your workload. In some cases, a well-written stored procedure will perform better for complex logic or when multiple result sets are needed.
Security and permissions
- ITVFs and views: grant appropriate permissions on the function or view so applications can access data without exposing underlying tables directly.
- Ownership chaining: ensure that the caller has permission to access the underlying objects, or explicitly grant access to the function/view if needed.
- Always use parameterized calls in application code to avoid SQL injection risks.
Migration notes and upgrade considerations
- If you’re planning to migrate from SQL Server 2008 to a newer version, you’ll gain features like improved TVFs, better parameter handling, and newer optimization features.
- In newer versions, you can still rely on inline TVFs as the preferred parameterized view alternative. You’ll often see better performance with updated statistics, indexing improvements, and enhanced query optimization.
- Review the upgrade path for your workload: if you heavily rely on parameterized access patterns, plan to introduce TVFs early in the migration to minimize changes to application code.
Real-world scenario: Orders by region with a parameter
Suppose you need to fetch recent orders for a specific region and customer:
CREATE FUNCTION dbo.GetRecentOrdersByRegion
@RegionName SYSNAME,
@FromDate DATETIME
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN
SELECT o.OrderID,
o.OrderDate,
o.TotalAmount,
o.CustomerID,
c.Region
FROM dbo.Orders AS o
INNER JOIN dbo.Customers AS c ON o.CustomerID = c.CustomerID
WHERE c.Region = @RegionName
AND o.OrderDate >= @FromDate
;
GO
Usage:
SELECT *
FROM dbo.GetRecentOrdersByRegion'North America', '2024-01-01';
This pattern keeps your filtering logic reusable and testable while avoiding dynamic SQL in the view layer. If you later need more complex rules, you can extend the ITVF or create additional ITVFs and compose them in queries.
Quick reference cheat sheet
- Can a view accept parameters in SQL Server 2008? No. Use ITVF or stored procedures instead.
- What is an inline table-valued function? A function that returns a table and can accept parameters, used as a parameterized data source.
- How do you use an ITVF? Create the function with parameters, then SELECT from it like a view.
- When should I prefer a stored procedure? When you need multiple result sets, complex logic, or procedural steps beyond a single SELECT.
- How can I improve performance with parameterized access? Index the necessary columns, use SCHEMABINDING where appropriate, and consider per-execution plans for sniffing issues.
- Can I use CROSS APPLY with a TVF? Yes, for advanced filtering or when combining data sources, but often you can achieve your goal with a direct ITVF call.
- Should I upgrade to a newer SQL Server version? If you rely on parameterized data access patterns, newer versions offer more optimization features and better tooling, but ITVFs remain a solid approach in 2008 as well.
- How do I handle security? Use proper permissions on the ITVF or view, and avoid exposing underlying tables directly.
- Are there performance pitfalls with functions? Avoid scalar UDFs in tight loops; stick to ITF/ITVF patterns for better set-based performance.
- What if I need to return more than one dataset? Stored procedures are often the right choice, as they can return multiple result sets.
Frequently Asked Questions
Can a SQL Server 2008 view accept parameters?
You can’t pass parameters to a view directly. Use an inline table-valued function ITVF or a stored procedure as an alternative.
What is an inline table-valued function ITVF?
An ITVF is a function that returns a table and can accept input parameters. It’s used to simulate parameterized views with the performance characteristics of a simple SELECT. How To Make A Discord Server On PC Step By Step Guide For Beginners And Pros 2026
How do I create an ITVF with parameters?
Define a function that RETURNS TABLE and accepts parameters, then write a RETURN that contains a SELECT statement with where clauses using those parameters.
How do I call an ITVF in a query?
SELECT * FROM dbo.GetRecentOrdersByCustomer@CustomerID, @FromDate;
Are ITVFs slower than views?
ITVFs that are properly indexed and written tend to perform well, often close to or better than views for parameterized use cases. Inline TVFs are generally more performant than multi-statement TVFs.
Can I use CROSS APPLY with a TVF?
Yes, CROSS APPLY can be used to combine data with a table-valued function, enabling advanced filtering and composition in complex queries.
When should I use a stored procedure instead of an ITVF?
If you need multiple result sets, procedural logic, or more complex output formatting, a stored procedure can be more flexible and maintainable. How to Make Your Discord Server Private A Step By Step Guide 2026
How do I optimize performance for parameterized data access?
Indexing on filter columns e.g., CustomerID, OrderDate, using SCHEMABINDING for ITVFs, avoiding scalar UDFs in queries, and managing query hints like OPTION RECOMPILE when sniffing is a concern.
How do I handle parameter sniffing in 2008?
Use query hints like OPTION RECOMPILE for critical queries, or assign local variables in a dynamic query to minimize plan reuse.
How do I secure parameterized data access?
Grant minimal permissions on ITVFs or views, ensure the underlying tables aren’t exposed directly, and follow standard security practices for stored procedures when applicable.
Is there a migration path to newer SQL Server versions for parameterized access?
Yes. Newer versions offer improved TVFs, TVPs table-valued parameters in procedures, and better optimization. Plan a phased migration to leverage these features while keeping your ITVF and procedure logic intact.
Can I convert an existing view into a parameterized pattern without changing application code?
You can create an ITVF that covers the same filtering logic, then replace view usage with calls to the ITVF. You may also adjust application code to pass the needed parameters to the ITVF or to a stored procedure. How to make your discord server public step by step guide for visibility, permissions, and moderation 2026
Do inline TVFs support indexing like views?
ITVFs themselves don’t get indexed, but you should index the underlying tables, and you can use SCHEMABINDING to stabilize metadata and potentially improve plan stability.
What’s the simplest starter example for a parameterized data access pattern?
Create a small ITVF that filters a table by a couple of commonly used parameters e.g., CustomerID and FromDate, then query the ITVF with concrete values. This gives you a quick win and a reusable pattern to expand.
Sources:
卡巴斯基免费版没了,现在怎么办?2025年免费安全软件与vpn推荐、免费杀毒软件对比、隐私保护、跨平台方案、速度与日志政策、如何选择
2025年最值得信赖的老牌VPN推荐:安全、稳定、速度全解析 How to Loop Cursor in SQL Server a Step-by-Step Guide to Looping, Fetching, and Performance 2026