1, date format
2013-01-01 : SELECT CONVERT(VARCHAR(20),GETDATE()+1,23)
2, 循环插入语句
declare @i int;
declare @room int;
set @room=560636;
set @i=1;
while(@i<100)
begin
INSERT INTO HtlReplDB..RoomInfo_intl
VALUES
(@room,CONVERT(VARCHAR(20),GETDATE()+@i,23), 4,4,0,9999,'G',9999,'业务',NULL,'L',6,'T','F','C',7,36,'F',0,'T',
'T','F',NULL,6,'T','F',GETDATE());
set @i=@i+1
end
3,日期时间差
WHERE datediff(d,getdate(),I.Effectdate)>=0
4, XML节点查找
SELECT response.value('(//IsBookable)[1]','nvarchar(5)')