Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sqlÈÕÆÚÄ£ºý²éѯ SQLʱ¼äת»»¸ñʽ

Select * from t_user_profile where convert ( varchar ( 21 ),regDate, 120 ) like ' 2008-05-07% ' ±íÃû³Æ£ºt_user_profile ÈÕÆÚ×Ö¶ÎÃû³Æ£ºregDate
Select   *   from t_user_profile  where  convert(varchar(21),regDate,120) like '2008-05-07%'
±íÃû³Æ£ºt_user_profile
ÈÕÆÚ×Ö¶ÎÃû³Æ£ºregDate
(ÔðÈα༭£ºadmin)
 
 
 
select Convert( varchar(20) , ʱ¼ä×ֶΠ, ¸ñʽ ) from ±í È磺select Convert(varchar(20),LOGIN_DATE,112) from dbo.C_PARTY_CLIENT 100£ºJun 22 2009 12:00AM 101£º06/22/2009 102£º2009.06.22 103£º22/06/2009 104£º22.06.2009 105£º22-06-2009 106£º22
select Convert(varchar(20),<ʱ¼ä×Ö¶Î>,<¸ñʽ>) from <±í>
È磺select Convert(varchar(20),LOGIN_DATE,112) from dbo.C_PARTY_CLIENT
100£ºJun 22 2009 12:00AM
101£º06/22/2009
102£º2009.06.22
103£º22/06/2009
104£º22.06.2009
105£º22-06-2009
106£º22 Jun 2009
107£ºJun 22, 2009
108£º00:00:00
109£ºJun 22 2009 12:00:00
110£º06-22-2009
111£º2009/06/22
112£º20090622
113£º22 Jun 2009 00:00:00
114£º00:00:00:000
120£º2009-06-22 00:00:00.
126:2009-06-22T00:00:00
127£º2009-06-22T00:00:00
131£º29/06/1430 12:00:00:
 ¸½ÉÏʱ¼ä±È½Ï£º
SELECT * from [TABLE] where   convert(varchar(10),<ʱ¼ä×Ö¶Î>,111) = @Time
SELECT * from ManualSign where  SignTime  BETWEEN  convert(datetime,@beginTime )  AND  convert(datetime,@endTime)
Ï£Íû¶Ô´ó¼ÒÓаïÖú¡£
 


Ïà¹ØÎĵµ£º

.net³ÌÐòÔ±ËùÐèÕÆÎÕµÄsql£¬»ù±¾¼¼ÇÉ(1)

1¡¢SessionÓÐʲôÖØ´óBUG£¬Î¢ÈíÌá³öÁËʲô·½·¨¼ÓÒÔ½â¾ö£¿
  ´ð£ºÊÇiisÖÐÓÉÓÚÓнø³Ì»ØÊÕ»úÖÆ£¬ÏµÍ³·±Ã¦µÄ»°Session»á¶ªÊ§£¬¿ÉÒÔÓÃSate server»òSQL ServerÊý¾Ý
¿âµÄ·½Ê½´æ´¢Session²»¹ýÕâÖÖ·½Ê½±È½ÏÂý£¬¶øÇÒÎÞ·¨²¶»ñSessionµÄENDʼþ¡£
2.²úÉúÒ»¸öintÊý×飬³¤¶ÈΪ100£¬²¢ÏòÆäÖÐËæ»ú²åÈë1-100£¬²¢ÇÒ²»ÄÜÖظ´¡£
C# ......

.net³ÌÐòÔ±ËùÐèÕÆÎÕµÄsql£¬»ù±¾¼¼ÇÉ(2)

1. ¼òÊö private¡¢ protected¡¢ public¡¢ internal ÐÞÊηûµÄ·ÃÎÊȨÏÞ¡£
´ð . private :  ˽ÓгÉÔ±, ÔÚÀàµÄÄÚ²¿²Å¿ÉÒÔ·ÃÎÊ¡£
    protected : ±£»¤³ÉÔ±£¬¸ÃÀàÄÚ²¿ºÍ¼Ì³ÐÀàÖпÉÒÔ·ÃÎÊ¡£
    public :    ¹«¹²³ÉÔ±£¬ÍêÈ«¹«¿ª£¬Ã»ÓзÃÎÊÏÞÖÆ¡£
    internal:  ÔÚÍ¬Ò ......

sql´æ´¢¹ý³Ì·ÖÒ³

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[pagination]
@tblName varchar(255), -- ±íÃû
@strGetFields varchar(1000), -- ÐèÒª·µ»ØµÄÁÐ
@fldName varchar(255), -- ÅÅÐòµÄ×Ö¶ÎÃû
@PageSize int, -- Ò³³ß´ç
@PageIndex int, -- Ò³Âë
@OrderType bit, -- ÉèÖÃÅÅÐòÀàÐÍ, ·Ç 0 Öµ ......

Sql ServerÖÐÈçºÎÅжϱí»òÕßÊý¾Ý¿âµÄ´æÔÚ

sql serverÖÐÈçºÎÅжϱí»òÕßÊý¾Ý¿âµÄ´æÔÚ£¬µ«ÔÚʵ¼ÊʹÓÃÖУ¬ÐèÅжÏStatus״̬λ£º
ÆäÖÐijЩ״̬λ¿ÉÓÉÓû§Ê¹Óà sp_dboption£¨read only¡¢dbo use only¡¢single user µÈ£©½øÐÐÉèÖãº
1 = autoclose£»Ê¹Óà sp_dboption ÉèÖᣠÊý¾Ý¿âÍêÈ«¹Ø±Õ£¬Æä×ÊÔ´ÔÚ×îºóÒ»¸öÓû§×¢ÏúºóÊÍ·Å¡£
4 = select into/bulkcopy£»Ê¹Óà sp_dbopti ......

SQL Server³£Óú¯Êý

ÔÚÊý¾Ý¿â²éѯÊý¾Ýʱ£¬ÎÒÃǾ­³£Ê¹ÓÃһЩº¯Êý£¬Ê¹ÎÒÃǵIJéѯ¸ü¼Ó·½±ã¿ì½Ý£¬ÏÂÃæ¾Í°ÑSQL ServerÖÐÎÒÃdz£Óõļ¸¸öº¯Êý¸øÁоٳöÀ´£¬¹©²Î¿¼¡£
1.×Ö·û´®º¯ÊýÓû§¿ØÖÆ·µ»Ø¸øÓû§µÄ×Ö·û´®£¬ÕâЩ¹¦ÄܽöÓÃÓÚ×Ö·ûÐÍÊý¾Ý¡£
2.ÈÕÆÚº¯ÊýÓÃÓÚ²Ù×÷ÈÕÆÚÖµ£¬ÎÒÃDz»ÄÜÖ±½Ó¶ÔÈÕÆÚÔËÓÃÊýѧº¯Êý¡£
3.Êýѧº¯ÊýÓÃÓÚ¶ÔÊýÖµ½øÐдúÊýÔËËã¡£
4.ϵͳº¯ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ