Week numbers in MS SQL Server
To get the current ISO 8601 week number in MS SQL Server, use the following code snippet:
SELECT DATEPART(iso_week, GETDATE());
* Ensure your system or application regional settings are set to follow ISO 8601 standards (weeks start on Monday) if the output varies.