SQL ServerÊý¾Ý¿â¹ÜÀí³£ÓÃSQLºÍT SQLÓï¾ä
1.²é¿´Êý¾Ý¿âµÄ°æ±¾
select @@version
2.²é¿´Êý¾Ý¿âËùÔÚ»úÆ÷²Ù×÷ϵͳ²ÎÊý
exec master..xp_msver
3.²é¿´Êý¾Ý¿âÆô¶¯µÄ²ÎÊý
sp_configure
4.²é¿´Êý¾Ý¿âÆô¶¯Ê±¼ä
select convert(varchar(30),login_time,120) from master..sysprocesses where spid=1
²é¿´Êý¾Ý¿â·þÎñÆ÷ÃûºÍʵÀýÃû
print ''Server Name...............: '' + convert(varchar(30),@@SERVERNAME)
print ''Instance..................: '' + convert(varchar(30),@@SERVICENAME)
5.²é¿´ËùÓÐÊý¾Ý¿âÃû³Æ¼°´óС
sp_helpdb
ÖØÃüÃûÊý¾Ý¿âÓõÄSQL
sp_renamedb ''old_dbname'', ''new_dbname''
6.²é¿´ËùÓÐÊý¾Ý¿âÓû§µÇ¼ÐÅÏ¢
sp_helplogins
²é¿´ËùÓÐÊý¾Ý¿âÓû§ËùÊôµÄ½ÇÉ«ÐÅÏ¢
sp_helpsrvrolemember
ÐÞ¸´Ç¨ÒÆ·þÎñÆ÷ʱ¹ÂÁ¢Óû§Ê±,¿ÉÒÔÓõÄfix_orphan_user½Å±¾»òÕßLoneUser¹ý³Ì
¸ü¸Äij¸öÊý¾Ý¶ÔÏóµÄÓû§ÊôÖ÷
sp_changeobjectowner [@objectname =] ''object'', [@newowner =] ''owner''
×¢Òâ: ¸ü¸Ä¶ÔÏóÃûµÄÈÎÒ»²¿·Ö¶¼¿ÉÄÜÆÆ»µ½Å±¾ºÍ´æ´¢¹ý³Ì¡£
°Ñһ̨·þÎñÆ÷ÉϵÄÊý¾Ý¿âÓû§µÇ¼ÐÅÏ¢±¸·Ý³öÀ´¿ÉÒÔÓÃadd_login_to_aserver½Å±¾
7.²é¿´Á´½Ó·þÎñÆ÷
sp_helplinkedsrvlogin
²é¿´Ô¶¶ËÊý¾Ý¿âÓû§µÇ¼ÐÅÏ¢
sp_helpremotelogin
8.²é¿´Ä³Êý¾Ý¿âÏÂij¸öÊý¾Ý¶ÔÏóµÄ´óС
sp_spaceused @objname
»¹¿ÉÒÔÓÃsp_toptables¹ý³Ì¿´×î´óµÄN(ĬÈÏΪ50)¸ö±í
²é¿´Ä³Êý¾Ý¿âÏÂij¸öÊý¾Ý¶ÔÏóµÄË÷ÒýÐÅÏ¢
sp_helpindex @objname
»¹¿ÉÒÔÓÃSP_NChelpindex¹ý³Ì²é¿´¸üÏêϸµÄË÷ÒýÇé¿ö
SP_NChelpindex @objname
clusteredË÷ÒýÊǰѼǼ°´ÎïÀí˳ÐòÅÅÁеģ¬Ë÷ÒýÕ¼µÄ¿Õ¼ä±È½ÏÉÙ¡£
¶Ô¼üÖµDML²Ù×÷Ê®·ÖƵ·±µÄ±íÎÒ½¨ÒéÓ÷ÇclusteredË÷ÒýºÍÔ¼Êø£¬fillfactor²ÎÊý¶¼ÓÃĬÈÏÖµ¡£
²é¿´Ä³Êý¾Ý¿âÏÂij¸öÊý¾Ý¶ÔÏóµÄµÄÔ¼ÊøÐÅÏ¢
sp_helpconstraint @objname
9.²é¿´Êý¾Ý¿âÀïËùÓеĴ洢¹ý³ÌºÍº¯Êý
use @database_name
sp_stored_procedures
²é¿´´æ´¢¹ý³ÌºÍº¯ÊýµÄÔ´´úÂë
sp_helptext ''@procedure_name''
²é¿´°üº¬Ä³¸ö×Ö·û´®@strµÄÊý¾Ý¶ÔÏóÃû³Æ
select distinct object_name(id) from syscomments where text like ''%@str%''
´´½¨¼ÓÃܵĴ洢¹ý³Ì»òº¯ÊýÔÚASÇ°Ãæ¼ÓWITH ENCRYPTION²ÎÊý
½âÃܼÓÃܹýµÄ´æ´¢¹ý³ÌºÍº¯Êý¿ÉÒÔÓÃsp_decrypt¹ý³Ì
10.²é¿´Êý¾Ý¿âÀïÓû§ºÍ½ø³ÌµÄÐÅÏ¢
sp_who
²é¿´SQL ServerÊý¾Ý¿âÀïµÄ»î¶¯Óû§ºÍ½ø³ÌµÄÐÅÏ¢
sp_who ''active''
²é¿´SQL ServerÊ
Ïà¹ØÎĵµ£º
˵Ã÷£º¸öÈ˸оõÔÚJavaÁìÓò´óÐÍ¿ª·¢¶¼Àë²»ÁËORMµÄÉíÓ°£¬ËùνµÄSSH¾ÍÊÇSpring+Struts+Hibernate£¬³ýÁËÔÚѧϰ»ù´¡ÖªÊ¶µÄʱºò±»¸æÖª¿ÉÒÔʹÓÃJDBC²Ù×÷Êý¾Ý¿âÖ®Í⣬´óÁ¿µÄÊé¼®Öж¼Êǽ²ÊöʹÓÃHibernateÕâ¸öORM¹¤¾ßÀ´²Ù×÷Êý¾Ý¡£ÔÚ.NETÖвÙ×÷Êý¾Ý¿âµÄ·½Ê½ÓжàÖÖ£¬³ýÁË×îÖ±½ÓµÄ·½Ê½¾ÍÊÇʹÓÃADO.NETÖ®Í⣬»¹¿ÉÒÔʹÓÃNHiber ......
ÏÂÔØsql2005ÍêÒÔºó½âѹ³öÀ´£¬´ó¼Ò¿ÉÒÔ¿´µ½cs_sql_2005_chs_x86Õâ¸öĿ¼£¬½øÈëÕâ¸öĿ¼ÔËÐÐsetup.exeÎļþ£¬°²×°³ÌÐò¾Í¿ªÊ¼ÔËÐÐÁË¡£
Ê×Ïȵ¯³öÀ´µÄÊÇÈí¼þÐí¿ÉÌõ¿î
¹´ÉÏÎÒ½Ó°®Ðí¿ÉÌõ¿îºÍÌõ¼þ£¬µãÏÂÒ»²½
ÕâÀïÁгöÁËSQL2005ÔËÐл·¾³£¬Ö±½Óµã°²×°
³ÌÐò¿ªÊ¼°²×°SQL2005ÔËÐбØÐèµÄ»·¾³£¬ÅäÖÃ×é¼þ
±ØÐèµÄ×é¼þ°²×°ºÃÁË£¬µãÏÂÒ»²½¼ ......
--²éѯÏÖÔÚÈÕÆÚ£¬Ö»ÒªÄêÔÂÈÕ
select convert(varchar(10),getDate(),120)
--²éѯÏÖÔÚÈÕÆÚ£¬Ö»ÒªÊ±·ÖÃë
select convert(varchar(8),getDate(),8)
Convertº¯ÊýµÄһЩ˵Ã÷£¬ÒÔÏÂ×ÊÁÏÀ´Ô´ÓÚÍøÂç
²»´øÊÀ¼ÍÊýλ (yy)
´øÊÀ¼ÍÊýλ (yyyy)
±ê×¼
ÊäÈë ......
1.Ö±½Óµ¼ÈëÊý¾Ý¿â
shp2pgsql -s "4326" -W "GBK" E:\shape\Road_polyline.shp
road_cross| psql -U postgres -h 172.17.40.83 -d test
2.µ¼³ösql
shp2pgsql -s "4326" E:\shape\Road_polyline.shp blocks >
E:\roadcross\blocks.sql
3 ......