In this post, I am sharing simple script to generate weekdays in SQL server.
select [DayId] = number , [DayName] = datename(dw, convert(datetime, cast(19000100 + number as varchar))) from master.dbo.spt_values where type = 'P' and number between 1 and 7Result
Refer related posts
No comments:
Write Comments