SQL×Ô¶¯Éú³ÉʵÌåÀà
declare @tablename varchar(20)
select @tablename = 'o_ems'
-------------Éú³É±äÁ¿,ʹÓñí¸ñÐÎʽ(ctrl + D)Êä³ö£¬È¡µÚÒ»¸ö×ֶεÄÖµ----------------------------------
select 'private '+
Case when t.name='varchar' Then 'string'
when t.name='char' Then 'string'
when t.name='datetime' Then 'datetime'
when t.name='int ' Then 'int'
when t.name='smallint' Then 'int'
when t.name='money' Then 'float'
when t.name='decimal' Then 'decimal'
when t.name='tinyint' Then 'byte'
else t.name end
+ ' _'+upper(substring(c.name,1,1))+lower(substring(c.name,2,(len(c.name)-1)))+';' as name /*,o.name,t.name,c.length,c.* ,isnull(m.text,'') */
from syscolumns c inner join sysobjects o on o.id=c.id
inner join systypes t on c.xtype=t.xtype
left outer join syscomments m on c.cdefault=m.id
where o.name =@tablename
order by c.id
-------------Éú³É·½·¨£¬Ê¹ÓÃÎı¾ÐÎʽ(ctrl + T)Êä³ö----------------------------------
select '/// <summary>' +char(13)+char(10)+'///'+char(13)+char(10)+'/// <summary>'+char(13)+char(10)
+ 'public '+ Case when t.name='varchar' Then 'string'
when t.name='char' Then 'string'
when t.name='datetime' Then 'datetime'
when t.name='int' Then 'int'
when t.name='smallint' Then 'int'
when t.name='money' Then 'float'
when t.name='decimal' Then 'decimal'
when t.name='tinyint' Then 'byte'
else t.name end
+ ' ' +upper(substring(c.name,1,1))+lower(substring(c.name,2,(len(c.name)-1)))+char(13)+char(10)
+ '{' +char(13)
Ïà¹ØÎĵµ£º
BackupEveryDay
ÿÌì½øÐÐÊý¾Ý¿âµÄ²îÒ챸·Ý
day
Declare @File Varchar(2000)
Set @File='E:\Databasebackup\njyc_data_diff.BAK'
Backup database njyc_data to Disk=@File with DIFFERENTIAL
WeekBackup
ÿÖܽøÐÐÒ»´ÎÊý¾Ý¿âµÄÍêÈ«±¸·Ý£¬±¸·ÝÎļþÃûΪµ±ÌìÈÕÆÚ £¨njyc_data_Äê_ÔÂ_ÈÕ£©
BackupAll
DECLARE @BackupFi ......
1. SET DEADLOCK_PRIORITY
˵Ã÷£º¿ØÖÆÔÚ·¢ÉúËÀËøÇé¿öʱ»á»°µÄ·´Ó¦·½Ê½¡£Èç¹ûÁ½¸ö½ø³Ì¶¼Ëø¶¨Êý¾Ý£¬²¢ÇÒÖ±µ½ÆäËü½ø³ÌÊÍ·Å×Ô¼ºµÄËøʱ£¬Ã¿¸ö½ø³Ì²ÅÄÜÊÍ·Å×Ô¼ºµÄËø£¬¼´·¢ÉúËÀËøÇé¿ö¡£
Óï·¨£ºSET DEADLOCK_PRIORITY { LOW | NORMAL | @deadlock_var }
²ÎÊý£ºLOW Ö¸¶¨µ±Ç°»á»°ÎªÊ×Ñ¡ËÀËøÎþÉüÆ·¡£Microsoft® S ......
ÔںܶàµÄ×ÊÁÏÖж¼ÃèÊö˵SQLSERVERµÄ´æ´¢¹ý³Ì½ÏÆÕͨµÄSQLÓï¾äÓÐÒÔÏÂÓŵ㣺
1. ´æ´¢¹ý³ÌÖ»ÔÚ´´Ôìʱ½øÐбàÒë¼´¿É£¬ÒÔºóÿ´ÎÖ´Ðд洢¹ý³Ì¶¼²»ÐèÔÙÖØбàÒ룬¶øÎÒÃÇͨ³£Ê¹ÓõÄSQLÓï¾äÿִÐÐÒ»´Î¾Í±àÒëÒ»´Î,ËùÒÔʹÓô洢¹ý³Ì¿ÉÌá¸ßÊý¾Ý¿âÖ´ÐÐËٶȡ£
2. &nbs ......
ת×Ô http://database.ctocio.com.cn/222/9068222.shtml
1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
¡¡¡¡2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
¡¡¡¡3¡¢Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
¡¡¡¡4¡¢ÄÚ´æ²»×ã
¡¡¡¡5¡¢ÍøÂçËÙ¶ÈÂý
¡¡¡¡6¡¢²éѯ³öµÄÊý¾ÝÁ¿¹ý´ó(¿ÉÒÔ²É ......
ÄÚÈÝÕªÒª£ºÔÚPL/SQL¿ª·¢¹ý³ÌÖУ¬Ê¹ÓÃSQL£¬PL/SQL¿ÉÒÔʵÏִ󲿷ݵÄÐèÇ󣬵«ÊÇÔÚijЩÌØÊâµÄÇé¿öÏ£¬ÔÚPL/SQLÖÐʹÓñê×¼µÄSQLÓï¾ä»òDMLÓï¾ä²»ÄÜʵÏÖ×Ô¼ºµÄÐèÇ󣬱ÈÈçÐèÒª¶¯Ì¬½¨±í»òij¸ö²»È·¶¨µÄ²Ù×÷ÐèÒª¶¯Ì¬Ö´ÐС£Õâ¾ÍÐèҪʹÓö¯Ì¬SQLÀ´ÊµÏÖ¡£±¾ÎÄͨ¹ý¼¸¸öʵÀýÀ´ÏêϸµÄ½²½â¶¯Ì¬SQLµÄʹÓᣡ¡¡¡
¡¡¡¡±¾ÎÄÊÊÒ˶ÁÕß·¶Î§£ºOracle³ ......