Redian新闻
>
测一下你的t-sql 功力
avatar
c*y
2

尝试一下
SQL Server 2008 Enterprise
declare @YY int;
declare @MM int;
set @YY = 2009;
set @MM = 11;
With CalenderCTE (DayNum,[Date],[WeekDay])
as(
select 1 as DayNum,
CONVERT(datetime,convert(nvarchar(8),@YY * 10000 + @MM * 100 + 1)) [
Date],
DATENAME(WEEKDAY,CONVERT(datetime,convert(nvarchar(8),@YY * 10000 +
@MM * 1
00 + 1))) [WeekDay]
union all
select Day(DATEADD(dd,1,[Date])) as DayNum,
DATEADD(dd,1,[Date]) as [Date],
DATENAME(WEEKDAY,DATE

【在 z***y 的大作中提到】
: http://beyondrelational.com/blogs/tc/archive/2009/11/30/tsql-challenge-18-generate-
: text-formatted-month-calendars.aspx

avatar
z*y
3
你的code比我的好太多, 我奖给你100个包子.

【在 c*******y 的大作中提到】
: 厄
: 尝试一下
: SQL Server 2008 Enterprise
: declare @YY int;
: declare @MM int;
: set @YY = 2009;
: set @MM = 11;
: With CalenderCTE (DayNum,[Date],[WeekDay])
: as(
: select 1 as DayNum,

avatar
z*y
4
if you could tweek your code regarding the collation requirement that would
be
perfect... Your current code is far better than mine...Great work!

【在 c*******y 的大作中提到】
: 厄
: 尝试一下
: SQL Server 2008 Enterprise
: declare @YY int;
: declare @MM int;
: set @YY = 2009;
: set @MM = 11;
: With CalenderCTE (DayNum,[Date],[WeekDay])
: as(
: select 1 as DayNum,

avatar
c*y
5
厄,献丑了
谢谢你的包子
年月标题应该挺容易加的吧:)

would

【在 z***y 的大作中提到】
: if you could tweek your code regarding the collation requirement that would
: be
: perfect... Your current code is far better than mine...Great work!

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。