from: http://blog.163.com/ck275601774/blog/static/1230468012009631113559291/
--ÈÕÆÚת»»²ÎÊý
select CONVERT(varchar,getdate(),120)
--2009-03-15 15:10:02
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')
--20090315151201
select CONVERT(varchar(12) , getdate(), 111)
--2009/03/15
select CONVERT(varchar(12) , getdate(), 112)
--20090315
select CONVERT(varchar(12) , getdate(), 102)
--2009.03.15
select CONVERT(varchar(12) , getdate(), 108)
--15:13:26
ÆäËüÎÒ²»³£ÓõÄÈÕÆÚ¸ñʽת»»·½·¨:
select CONVERT(varchar(12) , getdate(), 101 )
--03/15/2009
select CONVERT(varchar(12) , getdate(), 103 )
--15/03/2009
select CONVERT(varchar(12) , getdate(), 104 )
--15.03.2009
select CONVERT(varchar(12) , getdate(), 105 )
--15-03-2009
select CONVERT(varchar(12) , getdate(), 106 )
--15 03 2009
select CONVERT(varchar(12) , getdate(), 107 )
-- 15, 2009
select CONVERT(varchar(12) , getdate(), 109 )
--03 15 2009
select CONVERT(varchar(12) , getdate(), 110 )
--03-15-2009
select CONVERT(varchar(11) , getdate(), 113 )
--15 03 2009
select CONVERT(varchar(12) , getdate(), 114)
--15:15:55:717
declare @t varchar(20)
set @t='27/4/2009 00:00:01'
select convert( char(10),
--½ØÈ¡27/4/2009,²¢×ª»»Îª2009-4-27µÄÐÎʽ
convert(char(10),
convert(datetime,
left(@t,charindex(' ',@t)),
103),
120)
--½ØÈ¡00:00:01
+stuff(@t,1,charindex(' ',@t)-1,''),
120)
--2009-04-27
declare @time char(20)
declare @temp char(10)
declare @year char(4)
declare @month char(2)
declare @day char(2)
set @time = '2009/12/22 00:00:01'
select @temp = left(@time, charindex(' ', @time)-1)
select @year = left(@temp, charindex('/', @temp)-1)
select @temp = replace(@temp, @year+'/', '')
select @month = left(@temp, charindex('/', @temp)-1)
select @month = case
when len(@month)=1 then '0
ºÜ¾Ã֮ǰ¾ÍÏëÒª°Ñ×Ô¼ºµÄ¶ÁÊé¹ý³Ì¼Ç¼ÏÂÀ´£¬½ñÌìÉÔ΢ÕûÀíÁËһϣ¬ÈÏΪ²»¹ÜʲôÊ飬×Ô¼ºÃ»ÔõôÍêÕûµØ¿´Í꣬¸ü±ðÌáÈÏÕæµØÈ«²¿µØ¿´ÍêÁË¡£ÌýÈË˵£¬ÒªÑ¡1±¾ºÃÊéÀ´¿´£¬ÎÒ²»·´¶ÔÕâÖÖ˵·¨£¬µ«¸üÖØÒªµÄÊÇ£¬²»½öÊÇÊé±¾Éí£¬¶øÊÇÎÒÃÇ×Ô¼ºµÄÇé¿ö£¬ÊDz»ÊÇÕæÕýͶÈë½øÈ¥¿´ÁË£¬²»¹ÜÔõÑù£¬Ð´ÊéµÄÈ˵Ä֪ʶ¿Ï¶¨±ÈÄãÕâ·½ÃæµÄ֪ʶҪ¶®ºÜ¶à£¬ ......
ÔÚ¿ª·¢²»ÂÛÊÇWEB»¹ÊÇWinform³ÌÐòÖУ¬Êý¾Ý·ÖÒ³ÊǾ³£Óöµ½µÄÎÊÌ⣬ҪÊÇÔÚ´úÂëÖÐʵÏִ˹ý³Ì£¬ÏÔÈ»½µµÍÁË·þÎñÆ÷µÄЧÂÊ£¬¿ÉÒÔʹÓÃÒÔÏ´洢¹ý³ÌÀ´ÊµÏÖ¡£
CREATE PROCEDURE pagination
@tblName varchar(255), -- ±íÃû
@strGetFields varchar(1000) = '*', -- ÐèÒª·µ»ØµÄÁÐ
@fldName varchar(255)= ......
¸ÕÅöµ½Õâ¸öÎÊÌâʱ£¬ÒÔΪÊÇÓ¦Ó÷þÎñÆ÷ºÍÊý¾Ý¿â·þÎñÆ÷ûÁ¬Í¨£¬²éÁË°ëÌìµÄÍøÂç½á¹ûÍøÉÏÒ»²é£¬¸úSQL Server 2005Óйأ¬ÄãÌ«ÑôµÄ£¡
¿ªÊ¼²Ëµ¥-SQLServer2005-ÅäÖù¤¾ß-SQL Server Configuration Manager-SQLserver2005ÍøÂçÅäÖÃ-MSSQLSERVERµÄÐÒé-Ë«»÷TCP/IPÐÒé
°ÑIP¸Ä³Éµ±Ç°Ê¹Óõģ¬µ±È»£¬¶Ë¿ÚҲҪȷ±£ ......