SQL Server 2005 Common Built-in Functions

SQL Server Built-in Functions.

-Replace的用法:

select replace('zhou','z','x')
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')
--20090331151201

-Date Format:

select CONVERT(varchar,getdate(),120)
--2009-03-31 15:10:02

select CONVERT(varchar(12) , getdate(), 111)
--2009/03/31

select CONVERT(varchar(12) , getdate(), 112)
--20090331

select CONVERT(varchar(12) , getdate(), 102)
--2009.03.31

select CONVERT(varchar(12) , getdate(), 108)
--15:13:26

 

String Functions.

 

 

Sql Date Functions
posted @ 2009-03-30 15:17  lp123  阅读(242)  评论(0编辑  收藏  举报