SQL SERVERµ¼ÈëBAKÎļþ
ϵͳ»·¾³£ºwindows xp pro
Êý¾Ý¿â£ºMS Sql 2000
IIS: 5.1 ASP.NET2.0
ÒòΪ´úÂëÊÇ2.0.netµÄ,ûÓа취ֻºÃ°²×°ÁË.netÏÂÔØÄã¿ÉÒÔȥ΢ÈíµÄÍøÕ¾ÉÏÈ¥ÏÂÔØ.Õâ¸öÊÇÃâ·ÑµÄÈí¼þ£¬ÎÒÖªµÀµÄÊÇÃâ·ÑµÄ¡£
Êý¾Ý¿â×öÁËѹËõºó׺ÊÇbakµÄ£¬ËùÒÔÊý¾Ý¿â²»ÄÜÖ±½ÓʹÓã¬ÐèÒªµ¼ÈëÔÚÍøÉϲéÁ˺ܶàµÄ×ÊÁϵ«ÊDz»¶à£¬µ«×Ô¼º³É¹¦µ¼ÈëÁË£¬Ð´ÏÂÀ´×öÒ»¸ö±¸ÍüÒÔÃâÒÔºóÓÖÍü¼ÇÁË¡£
Ê×ÏÈ´ò¿ªSQLµÄÆóÒµ¹ÜÀí¹¤¾ß£¬´ò¿ªÊý¾Ý¿âÏî¿ÉÒÔ¿´µ½×ó²àÓкܶàµÄÊý¾Ý¿â£¬ÄǸöϵͳ×Ô´øµÄ²»Òª¶¯£¬ÔÚÓÒ²à¿Õ°×´¦µãÓÒ¼üÑ¡“ËùÓÐÈÎÎñ”“»¹ÔÊý¾Ý¿â”ÔÚ“»¹Ô”ºóÓÐÈý¸öÑ¡ÏîÒÀ´ÎÊÇ“Êý¾Ý¿â”“Îļþ×é»òÎļþ”“´ÓÉ豸”Ñ¡Ôñ“´ÓÉ豸”ÔÚ“²ÎÊý”Ñ¡ÔñÒ»¸öÉ豸£¬Õâ¸öÆäʵ¾ÍÊÇÄã´æ·ÅBAKÎļþµÄ´ÅÅÌ£»ÁíÒ»¸öÎÊÌâ¾ÍÊÇÑ¡Ôñ“Ñ¡Ïî”Ñ¡Ôñ“ÔÚÏÖÓÐÊý¾Ý¿âÉÏÇ¿ÖÆ»¹Ô”È»ºó´òµ½ÄãÒª»¹ÔµÄBAKÊý¾Ý¿âÑ¡»¹Ô¾Í¿ÉÒÔÁË¡£
ÔÚ»¹ÔµÄ¹ý³ÌÖÐÓöµ½Ò»¸ö´íÎóµÄÌáʾ´óÌåÒâ˼ÊÇ˵É豸´íÎó»òËð»µÎÞ·¨»¹ÔÖ¸¶¨µÄÊý¾Ý¿â£¬¿ªÊ¼µÄʱºò×Ô¼ºÒÔΪÊÇSQLÓÐÎÊÌâµÄ£¬ºóÀ´×Ðϸ¿´ÁËһϷ¾¶£¬ÔÀ´ÊÇĬÈϵÄ·¾¶²»´æÔÚÔì³É´íÎóµÄÌáʾ£¬ÒòΪ×Ô¼ºÔÚ°²×°SQLµÄʱºò°ÑĬÈÏ´æ·ÅÊý¾Ý¿âµÄ·¾¶ÐÞ¸ÄÁË£¬ËùÒÔÔì³ÉÁË´íÎó£¬Õâ¸öÎÊÌâ±È½ÏºÃ½â¾ö£¬¾ÍÊÇ°ÑÒª»¹ÔµÄÊý¾Ý¿âÖØÐÂÖ¸¶¨Ò»Ï·¾¶ÎÊÌâ¾Í¿ÉÒÔ½â¾öÁË£¡
Ïà¹ØÎĵµ£º
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database db ......
transaction 1:
------------------------------------------------------
begin transaction
update table1 set cola = 'str1'
Waitfor time '10:12:00'
update table2 set colb = 'str2'
rollback transaction
transaction 2:
---- ......
Ò» sqlÓï¾äµÄÖ´Ðв½Öè
1£©Óï·¨·ÖÎö£¬·ÖÎöÓï¾äµÄÓï·¨ÊÇ·ñ·ûºÏ¹æ·¶£¬ºâÁ¿Óï¾äÖи÷±í´ïʽµÄÒâÒå¡£
2£© ÓïÒå·ÖÎö£¬¼ì²éÓï¾äÖÐÉæ¼°µÄËùÓÐÊý¾Ý¿â¶ÔÏóÊÇ·ñ´æÔÚ£¬ÇÒÓû§ÓÐÏàÓ¦µÄȨÏÞ¡£
3£©ÊÓͼת»»£¬½«Éæ¼°ÊÓͼµÄ²éѯÓï¾äת»»ÎªÏàÓ¦µÄ¶Ô»ù±í²éѯÓï¾ä¡£
4£©±í´ïʽת»»£¬ ½«¸´Ô SQL ±í´ïʽת»»Îª½Ï¼òµ¥µÄµÈЧÁ¬½Ó±í´ïʽ¡ ......
Òý:ÏÖÔÚһЩÖÐСÆóÒµ¶¼¹ã·ºÊ¹ÓÃMS Windows NT ΪÍøÂç²Ù×÷ϵͳƽ̨£¬SQL Server Ϊºǫ́Êý¾Ý¿â¹¹½¨ÆóÒµÄÚ²¿µÄ¸÷ÖÖ¹ÜÀíϵͳ£¬¸Ã³ÉÊì¼¼ÊõµÄÆÕ¼°£¬ÄÜÓÐЧµØ°ïÖúÆóÒµ¶ÔÄÚ²¿Êý¾Ý½øÐйÜÀí¡£ÕâÀàÓ¦ÓÃÖУ¬¶ÔÊý¾Ý¿âµÄ±¸·ÝÊǺÜÖØÒªµÄÒ»Ï×÷£¬ÆäÖØÒªÐÔ²»±Ø¶àÑÔ¡£
¡¡¡¡Æ䱸·ÝµÄ·½·¨ºÜ¶à£¬È磺ÔÚһЩ¹æÄ£½Ï´ó¡¢×ʽðÐÛºñµÄÆóÒµ£¬ÍùÍùÊÇ ......
ÈçºÎÓÃÃüÁîÉú³ÉSQL SERVER½Å±¾
--ÒÔÏÂÉú³ÉÕû¸öÊý¾Ý¿âµÄSQL½Å±¾£¬ÎÒ²âÊÔÁË£¬Ï൱ºÃÓá£
--(scptxfr.exeµÄ·¾¶ÒªÕýÈ·ÒÔÏÂÊÇÎҵķ¾¶)
declare @cMd varchar(1000)
set @cmd = 'master.dbo.xp_cm ......