ͨ¹ýSQL Server Agent·½Ê½ÊµÏÖÊý¾Ý¿â×Ô¶¯±¸·Ý£¡
--ÓÃJOB.
--SQL SERVER2000ΪÀý
ÆóÒµ¹ÜÀíÆ÷—>Êý¾Ý¿â·þÎñÆ÷—>¹ÜÀíĿ¼—>SQL SERVER´úÀí—>×÷Òµ—>ÓÒ¼ü Ñ¡—>н¨
³£¹æÑ¡ÏîÒ³—>ÊäÈë×÷ÒµÃû³Æ—>Ñ¡ÖÐËùÓÐÕß¡£
²½ÖèÑ¡ÏîÒ³—>н¨—>ÊäÈë²½ÖèÃû—>ÀàÐÍ TSQL½Å±¾—>Ñ¡ÔñÐèÒªÖ´ÐеÄÊý¾Ý¿â—>ÔÚÃüÁî¿òÀïÊäÈëÄãµÄSQL ½Å±¾£º
È磺Backup Database tedmdb To Disk='D:/test.bak'
Äã¿ÉÒÔµã×óϽǵġ¾·ÖÎö¡¿°´Å¥£¬·ÖÎöÒ»ÏÂÓï·¨£¬·ÖÎöÎÞÎ󣬰´È·¶¨¡£
µ÷¶ÈÑ¡ÏîÒ³—>н¨µ÷¶È—>ÊäÈëµ÷¶ÈÃû³Æ—>µ÷¶ÈÀàÐÍ Äã¿ÉÒÔÑ¡ÔñÒ²¿ÉÒÔµãÓÒϽǵġ¾¸ü¸Ä¡¿°´Å¥½øÐиü¸Ä£¬È·¶¨¡£
ÈÎÎñÀ¸ SQL SERVER·þÎñÆ÷µÄСͼ±ê Ë«»÷ ·þÎñ Ñ¡ÖÐ SQL SERVER AGENT,µã¡¾¿ªÊ¼/¼ÌÐø¡¿£¬Ñ¡Öе±Æô¶¯OSʱ£¬×Ô¶¯Æô¶¯·þÎñ£¬¾Í¿ÉÒÔÁË¡£
µ½Ä㶨µÄÄǸöʱ¼äµã£¬SQL SERVER»á×Ô¶¯È¥Ö´ÐÐÄãµÄ½Å±¾µÄ¡£
Èç¹ûÐèÒªÉú³É½Å±¾µÄ»°£¬ÆóÒµ¹ÜÀíÆ÷—>Êý¾Ý¿â·þÎñÆ÷—>¹ÜÀíĿ¼—>SQL SERVER´úÀí—>×÷Òµ—>ÓÒ¼üÄã¸ÕÍê³ÉµÄ×÷Òµ—>ËùÓÐÈÎÎñ
—>Éú³ÉSQL½Å±¾£¬¼´¿ÉÉú³ÉÄãÐèÒªµÄ½Å±¾¡£
´úÂ룺
-- Script generated on 2009-10-16 14:56
-- By: sa
-- Server: (LOCAL)
BEGIN TRANSACTION
DECLARE @JobID BINARY(16)
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
IF (SELECT COUNT(*) from msdb.dbo.syscategories WHERE name = N'Database Maintenance') < 1
EXECUTE msdb.dbo.sp_add_category @name = N'Database Maintenance'
-- Delete the job with the same name (if it exists)
SELECT @JobID = job_id
from msdb.dbo.sysjobs
WHERE (name = N'db_auto_backup_test')
IF (@JobID IS NOT NULL)
BEGIN
-- Check if the job is a multi-server job
IF (EXISTS (SELECT *
 
Ïà¹ØÎĵµ£º
1.Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)¡¡¡¡
¡¡¡¡ SQLSERVERµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í£¬µ±SQLSERVER´¦Àí¶à¸ö±íʱ£¬»áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á ......
ÔÚsql server 2005À¸ù¾ÝÊý¾Ý¿âÐÔÄܶ¯Ì¬¹¹½¨Ë÷Òý¡£
Êý¾Ý¿âÉè¼ÆºÃºó£¬ÏµÍ³ÉÏÏßÔ˶¯Ò»¸öÖÜÆÚºó£¬Êý¾Ý¿âÐÔÄÜÆ¿¾±Í»ÏÖ³öÀ´£¬Õâ¸öʱ¼ä£¬ÐèÒªÒ»ÖÖ¸ù¾ÝÐÔÄÜ£¬À´¶¯Ì¬¹¹½¨Ë÷Òý£¬Ìá¸ß²éѯЧÂÊ¡£
--¹ý³ÌÓÅ»¯SQL
&nb ......
SELECT COUNT(*) from USER_TAB_COLUMNS WHERE TABLE_NAME=UPPER('pow_role')
ͳ¼Æpow_role±íµÄÁÐÊý
ÆäÖÐ USER_TAB_COLUMNS ÊÇϵͳ×Ô´øµÄ±í¡£
pow_roleÊÇҪͳ¼ÆµÄ±íÃû¡£
Èç¹ûҪͳ¼ÆÆäËûµÄ±íµÄÁÐÊýÖ»ÐèÒª°Ñ±íÃû»»Ò»Ï¾ͿÉÒÔÁË£¬Èç
SELECT COUNT(*) from USER_TAB_COLUMNS WHERE TABLE_NAME=UPPER('POW_ROLE_GROUP')&nb ......
http://topic.csdn.net/u/20091016/09/fea7e9d3-53c4-4b00-9abe-dbf8dd55b05b.html?seed=1546300155&r=60454236#r_60454236
ÔÎÊÌ⣺
Êý¾ÝÈçÏÂ, ÎÒÏëÈ¡³öTABLEÖеÄÊý¾Ý, °´ÕÕÏÂÃæµÄÌõ¼þ.
Èç¹ûF2ÏàͬµÄÇé¿öÏÂ, È¡F3Êý¾Ý½ÏСµÄÄÇÌõ, Èç¹ûF3»¹Ïàͬ, ¾ÍÈ¡F4½ÏСµÄÄǸö, ÒÀ´Î...
Çë½Ì¼òµ¥µãЧÂʸߵãµÄSQL, ÒòΪÊý¾Ý½Ï¶à, ......
ÍøÕ¾Êý¾Ý¿âÖÖÂí
Êý¾Ý¿âÖкܶà±í´æÔÚ´óÁ¿Ïàͬ¼Ç¼
¾¸ßÈËÖ¸µãɾ³ýÏàͬ¼Ç¼(½ö±£ÁôÒ»¸ö)µÄSQLÓï¾äÈçÏÂ
declare @tmptb TABLE (
[ID] [int] NOT NULL ,
[SortName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[SortNote] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[ParentI ......