SQLSERVER´óÅúÁ¿Êý¾Ý²Ù×÷ʱËùÕ¼ÓÃÄÚ´æÊÍ...
ÏÖÏó£º
ÏÖÔÚ×öÒ»¸ö³ÌÐò£¬¶ÔÊý¾Ý¿âµÄ¼¸¸ö×°ÓдóÁ¿Êý¾ÝµÄ±í½øÐвÙ×÷£¬¶ÔÆäÖеÄÒ»¸ö±í½øÐÐ
Ñ»·²Ù×÷£¬ÒÔ´¦ÀíÆäËûµÄ¼¸¸ö±í¡£ÆäÖÐÓõ½Á˼¸¸öquery,update£¬µ±³ÌÐòÅܵĹý³ÌÖУ¬
SQLSERVERµÄÄÚ´æ²»¶ÏµÄÔö³¤£¬ÅÜÍêºó¹Ø±Õ³ÌÐòÍ˳öºóÒ²²»½µÏÂÀ´¡£
½â¾ö£º
ÕâÊÇSQLµÄÄÚ´æ¹ÜÀí»úÖƾö¶¨µÄ£¬SQL¹ÜÀíÄÚ´æµÄÔÔòÊÇÕâÑùµÄ,Ö»ÒªÄãµÄÄÚ´æ¹»ÓÃ(Õâ¸ö¹»ÓÃÊÇÖ¸Äã·ÖÅä¸øSQLµÄ¿ÉÓÃÄÚ´æ),ÔòSQL²»»áÊÍ·ÅÕ¼ÓõÄÄÚ´æ,еIJÙ×÷»á·ÖÅäеÄÄÚ´æ,Ö±µ½·ÖÅäÍê¿ÉÓõÄÄÚ´æºó,²Å»áÊÍ·ÅÄڴ棬ÒòΪÄÚ´æÕ¼ÓûáÒ»Ö±ÉÏÕÇ,Ö±µ½´ïµ½¼«ÏÞ
½â¾öµÄ·½·¨ÊÇÏÞÖƸøSQLµÄ¿ÉÓÃÄÚ´æÁ¿
ÁíÍ⣬¶ÔÓÚƵ·±²Ù×÷Êý¾Ý¿âµÄ²Ù×÷£¬²»ÒªÃ¿Ò»´Î¶¼È¥getConnection£¬È»ºóÔÙclose£¬ÕâÑùÊǺÜÏûºÄÄÚ´æµÄ£¬sql serverµÄÄÚ´æ»á³ÖÐøÔö³¤£¬¼´Ê¹Ã¿´Î¶¼¶Ôconnection×öÁËclose£¬sql serverµÄÄڴ滹Êǻ᲻ͣÔö³¤£¬ËäÈ»sql server»á×Ô¶¯µ÷½Ú£¬²»»áÈÃϵͳËÀµô£¬µ«ÊÇÄÚ´æÌ«ÉÙ£¬×öÈκβÙ×÷¶¼»á±äµÄºÜÂýÁË¡£¿ÉÐеİ취ÊÇ£¬¶ÔÓÚƵ·±µÄÊý¾Ý¿â²Ù×÷£¬¸ù¾ÝÖ´ÐеÄÀàÐÍ£¬±ÈÈç°´select¡¢update¡¢insertÀ´·ÖÀ࣬ÔÚÄÚ´æÖн¨Á¢staitc Connection£¬ÈÃÕâЩƵ·±µÄ²Ù×÷£¬Ò²¾ÍÊÇ˵¼õÉÙConnectionµÄ½¨Á¢ÊýÁ¿£¬ÕâÑù¾Í»á´ó·ù¶ÈµÄ½µµÍÄÚ´æµÄÏûºÄÁ¿£¬Äڴ漸ºõ²»Ôö³¤ÁË£¬ÎÊÌâ¾Í½â¾öÁË¡£
Ïà¹ØÎĵµ£º
·½Ê½Ò»£º
select top 200 * from view_OrganResource
where 1=1 and OrganID = 57 and
(OrderID not in(select top 1000 OrderID from tb_OrganResource
where 1=1 and OrganID = 57 order by uploadtime desc))
order by uploadtime desc --5858 1980
·½Ê½¶þ£º
select top 200 * from
vi ......
Óαê²Ù×÷µÄÁù²½Öè:
¡ôÔÚÿ´ÎÔÚ´´½¨ÓαêµÄʱºò¶¼ÎÊÎÊ×Ô¼º,ÓÃʲô±ðµÄ·½·¨¿ÉÒÔ±ÜÃâʹÓÃÓαê,ÄÇôÄã¾Í²½ÈçÉè¼ÆµÄÕý¹æÁË.
1.ÉùÃ÷
2.´ò¿ª
3.Ó¦ÓÃ/²Ù×÷
4.¹Ø±Õ.
5.ÊÍ·Å
&nbs ......
·ÖÁ½ÖÖÇé¿ö£º
1¡¢Í¨¹ý½Å±¾·½Ê½£¬2¡¢µ¼Èëµ¼³ö·½Ê½
µ«²»Í¬°æ±¾µÄSqlServer,ÔÚÕâ·½Ãæ²¢²»Ïàͬ¡£
sql2000¶ÔÊý¾Ý¿â¶ÔÏóÖ´ÐÐÉú³É½Å±¾Ê±£¬¾¡¹Ü¶¼Ñ¡Éϸ÷¸öÌõ¼þ£¬µ«¶ÔÓÚ±í¶ÔÏó²¢²»ÄÜ´´½¨Ö÷¼ü
¿ÉÒÔͨ¹ýµ¼Èëµ¼³ö·½Ê½£¬ÔÚµ¼ÈëÄ¿±êÑ¡ÔñÄ¿±êsqlserverºó£¬Ñ¡ÔñÖ»µ¼³ö¶ÔÏó½á¹¹¾ÍºÃÁË¡£
sql2005¶ÔÊý¾Ý¿â¶ÔÏóÖ´ÐÐÉú³É½Å±¾Ê±£¬¿ÉÒÔ´´½¨Ö÷¼ ......
±¾À´ÎÒÊDz»ÔÞ³ÉʹÓÃͨÓô洢¹ý³ÌµÄ£¬Ö÷ÒªÊÇÒòΪ¸ù¾Ý±í½á¹¹À´¶¨ÖÆ·ÖÒ³²éѯ²»Óö¯Ì¬µÄÆ´SQL£¬ÕâÑù²ÅÊÇÕæÕýµÄ¸ßЧ£¬¶øÇÒֻҪд¹ýÒ»¸ö£¬ÄÇôÔÙÓÐÐÂÐèÇóµÄʱºò£¬Ð¡·¶Î§¸Ä¶¯¼¸´¦¾ÍokÁË¡£
µ«×ÜÊÇÓÐÈËÏòÎÒÌÖÒª»òÕßÌÖÂÛͨÓô洢¹ý³Ì£¬Ã»°ì·¨£¬±»±ÆÎÞÄΣ¬Á¼ÐÄÉ¥ÓëÀ§¾³¡£
ľÓÐÕÒµ½T-SQL´úÂë±à¼Æ÷
-- ============================= ......
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack
4¡¢Ëµ ......