Sql server Case when
select
WorksheetID,worker,WorkDate,merchantName ,merchantNo ,manager
, case when insCount>0 then 'ÐÂ×°' else '' end InsStr
,case when repCount>0 then '»»×°' else '' end RepStr
,case when UnInsCount>0 then '³·»ú' else '' end UnInsStr
,case when FaultCount>0 then '¹ÊÕÏ´¦Àí' else '' end FaultStr
,case when VisitCount>0 then 'Ѳ¼ì' else '' end VisitStr
,case when SendConsumableCount>0 then 'ºÄ²ÄÅäËÍ' else '' end SendConsumableStr
,case when SoftUpdateCount>0 then '³ÌÐòÉý¼¶' else '' end SoftUpdateStr
,case when takeSheetCount>0 then 'È¡Ë͵¥¾Ý' else '' end takeSheetStr
from MaintainInfo_ReadyForData;
Ïà¹ØÎĵµ£º
ת×Ôhttp://blog.csdn.net/ziren235/archive/2007/07/03/1676347.aspx
ÔÚSQL Server2000ÖУ¬Ò»¸öÊý¾Ý¿âµÄÈÕÖ¾ÊÇÒÔ*.ldf Îļþ´æ·Å,ÇëÎÊÎÒÏë²é¿´Ä³Ò»¸öÊý¾Ý¿âµÄÈÕÖ¾,¸ÃÈçºÎ²Ù×÷.
·½·¨1¡¢
DBCC LOG('DatabaseName',2)
·½·¨2:
select * from ::fn_dblog(default,default)
·½·¨3
ÓÃLog Explorer ......
ÔÚSQL Server2000ÖУ¬Ò»¸öÊý¾Ý¿âµÄÈÕÖ¾ÊÇÒÔ*.ldf Îļþ´æ·Å,ÇëÎÊÎÒÏë²é¿´Ä³Ò»¸öÊý¾Ý¿âµÄÈÕÖ¾,¸ÃÈçºÎ²Ù×÷.
·½·¨1¡¢
DBCC LOG('DatabaseName',2)
·½·¨2:
select * from ::fn_dblog(default,default)
·½·¨3
ÓÃLog Explorer ......
ÔÚSQL Server Unicode×Ö·û´®³£Á¿ÐèҪǰ׺N
µ±ÔÚSQL
SERVERÀï±ß´¦Àí×Ö·û´®³£Á¿µÄʱºòÄã±ØÐëÔÚ³£Á¿Ö®Ç°·ÅÒ»¸ö´óдµÄN,¾ÍÏñSQL
SERVERÁ¬»úÎĵµ±êÌâΪ"²ÉÓÃUnicodeÊý¾Ý"Ëù˵Ã÷µÄÄÇÑù.Nǰ׺ÏóÕ÷×ÅÔÚSQL-92
±ê×¼µÄ¹ú¼ÒÓïÑÔ,²¢ÇÒ±ØÐëÊÇ´óд×Öĸ.Èç¹ûÄãÔ ......
1¡¢³£ÓÃÈÕÆÚ·½·¨(ÏÂÃæµÄGetDate() = '2006-11-08 13:37:56.233')
(1)DATENAME ( datepart ,date )
·µ»Ø±íʾָ¶¨ÈÕÆÚµÄÖ¸¶¨ÈÕÆÚ²¿·ÖµÄ×Ö·û´®¡£DatepartÏê¼ûÏÂÃæµÄÁбí.
SELECT DateName(day,Getdate()) –·µ»Ø8
(2)DATEPART ( datepart , date )
·µ»Ø±íʾָ¶¨ÈÕÆÚµÄÖ¸ ......
ÎÄÕÂÓÉÀ´£º ×î½üÐèÒª×öÕâÑùµÄ²âÊÔ:Install the products on machine which case-insensitive SQL installed.
Ëùνcase-insensitive SQL installed¡¡Ö¸ÔÚÊý¾Ý¿â°²×°Ê±Ñ¡ÔñÅÅÐò¹æÔòʱ¡¡ÐèҪѡÔñ´óÐ¡Ð´Çø±ðµÄ¹æÔò¡£
¡¡¡¡ÅÅÐò¹æÔò¼ò½é£º
¡¡¡¡¡¡¡¡MSÊÇÕâÑùÃèÊöµÄ£º"ÔÚ Micr ......