¶àÌõ¼þ²éѯ´æ´¢¹ý³Ì SQL Server
¶àÌõ¼þ²éѯ´æ´¢¹ý³Ì
¶àÌõ¼þ²éѯ´æ´¢¹ý³Ì ÀýÒ»
create proc pr_select_Natural
(
@CDATE datetime,
@FAC_NAME varchar(50),
@BATTERY_TYPE varchar(20),
@MAKE_MODE varchar(20),
@PRODUCE_MODE varchar(20),
@YEAR char(4),
@MONTH char(2),
@TDATE datetime,
@PAGENUM varchar(12)
)
as
declare @strWhere varchar(500)
if ( @CDATE = null )
set @strWhere = @strWhere+' and CDATE ='+ @CDATE
if ( @FAC_NAME = null )
set @strWhere = @strWhere+' and FAC_NAME like ''%''+@FAC_NAME+''%'' '
if ( @BATTERY_TYPE = null )
set @strWhere = @strWhere+' and BATTERY_TYPE like ''%''+@BATTERY_TYPE+''%'''
if ( @MAKE_MODE = null )
set @strWhere = @strWhere+' and MAKE_MODE like ''%''+@MAKE_MODE+''%'''
if ( @PRODUCE_MODE = null )
set @strWhere = @strWhere+' and PRODUCE_MODE like ''%''+@PRODUCE_MODE+''%'''
if ( @YEAR = null )
set @strWhere =@strWhere+ ' and YEAR like ''%''+@YEAR+''%'''
if ( @MONTH = null )
set @strWhere = @strWhere+' and MONTH like ''%''+@MONTH+''%'''
if ( @TDATE = null )
set @strWhere = @strWhere+' and TDATE = @TDATE'
if ( @PAGENUM = null )
set @strWhere = @strWhere+' and PAGENUM like ''%''+@PAGENUM+''%'''
set @strMAIN = 'select
CDATE as ³ö³§Ê±¼ä,
FAC_NAME as ·¢»õ³§¼Ò,
BATTERY_TYPE as µç³ØÐͺÅ,
SEND_TYPE as ·¢»õÀàÐÍ,
SEND_NUM as ¼ì²âÊýÁ¿,
MAKE_MODE as ÖÆ×÷·½Ê½,
PRODUCE_MODE as Éú²ú·½Ê½,
BATTERY_NUM as µç³Ø×éÊýÁ¿,
[YEAR] as Äê,
[MONTH] as ÔÂ,
TDATE as ÈÕÆÚ,
SEND_RULE as ·¢»õ¹æÔò,
SEND_CODE as ·¢»õ×é±àºÅ,
BATTERY_SORT as µç³ØÀà±ð,
PAGENUM as ÌõÂëºÅ,
FITTING_CODE as ×°ÅäºÅ,
LINE_CODE as Éú²ú»úºÅ,
FLAG as ÊÇ·ñ·ÅÐÐ,
REMARK as ±¸×¢,
OTHER as ÆäËû,
BLANK_COL as ¿Õ°×ÁÐ
from T_INFOCODE_NATUR
Ïà¹ØÎĵµ£º
Õ⼸ÌìÒ»Ö±±»ÖÐÎÄÂÒÂëÎÊÌâÀ§ÈÅ£¬ÖÐÎÄÊý¾Ý²åÈëµ½My SqlÖкÜÕý³££¬ÔÚCommand client lineÖÐÒ²ÄÜÕý³£ÏÔʾ£¬¿É´ÓÊý¾Ý¿âÖжÁµ½JSPÒ³ÃæÉÏʱ£¬¾Í±ä³É“»ðÐÇÎÄ”ÁË¡£
¡¡¡¡ÓÚÊÇÉÏÍø²éѯ£¬Ò²¿´µ½ºÃ¶à·½·¨£ºÓеÄ˵°Ñmy.iniÖÐdefault-character-set=latin1¸ÄΪdefault-character-set=utf8,ÓÐ ......
Çå¿ÕÈÕÖ¾£º
dump transaction ¿âÃû with no_log
½Ø¶ÏÈÕÖ¾£º
backup log ¿âÃû with no_log
ѹËõÊý¾Ý¿â£º
dbcc shrinkdatabase (¿âÃû, Ä¿±ê±ÈÂÊ)
ѹËõÊý¾Ý¿âÎļþ£º
dbcc shrinkfile (ÎļþÃû»òID, Ä¿±ê´óС)
ÎļþÃû»òID¿ÉÒÔͨ¹ýϵͳ±ísysfiles²éÕÒ£¬Èç¹û²»Ö¸¶¨Ä¿±ê´óСSQL Server½«×î´óÏ޶ȵÄѹËõÊý¾Ý¿âÎļþ¡£
²é¿´Ñ¹ ......
Ç°²»¾Ã¿´µ½Í¬ÊÂÔÚÓÃSql Prompt3.9£¬¾õµÃÂù·½±ãµÄ¡£¸øÎÒÃÇд³ÌÐòÄÜʡϲ»ÉÙÁ¦Æø¡£·½±ã£¬sql´úÂë¿´ÆðÀ´ÓÖ¼ò½é¡£ÖµµÃÍƼö¡£http://www.red-gate.com/ÕâÊÇËüµÄ¹ÙÍø£¬ÊÇÒ»¿îÊշѵÄÈí¼þ¡£Õýʽ°æ±¾ÏÂÔØÏÂÀ´Ö»ÄÜʹÓÃ14Ìì¡£·Ï»°²»ËµÁË£¬ÏÈ¿´ÏÂЧ¹ûͼ£º
»¹²»´í°¡¡£
½ÓÏÂÀ´½éÉÜÏÂÆƽâµÄ·½·¨£¬Ïȵ½¹ÙÍø°Ñ×îаæ(ÏÖÔÚÒѾÊÇ3.9ÁË)ÏÂÏÂÀ ......
Oracle SQLÐÔÄÜÓÅ»¯¼¼ÇÉ´ó×ܽá ÊÕ²Ø
£¨1£©Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
OracleµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐ3¸öÒÔ ......