ͨ¹ý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.´ò¿ªSQL server enterprise mananger “ÆóÒµ¹ÜÀíÆ÷”
ÔÚÄãÒªµ¼³öµÄSQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý
2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£
3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍÎ ......
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 ......
A left join B µÄÁ¬½ÓµÄ¼Ç¼ÊýÓëA±íµÄ¼Ç¼Êýͬ
A right join B µÄÁ¬½ÓµÄ¼Ç¼ÊýÓëB±íµÄ¼Ç¼Êýͬ
A left join B µÈ¼ÛB right join A
table A:Field_K, Field_A1 a3 b4 ctable B:Field_K, Field_B1 x2 &nbs ......
declare @str varchar(8000),@sql varchar(8000)
set @str=''
select @str=@str+','+name from syscolumns WHERE ID=OBJECT_ID('±íÃû') AND NAME!='ÒªÅųýµÄÁÐÃû'
set @str=stuff(@str,1,1,'')
set @sql='select '+@str+' from ±íÃû'
exec (@sql) ......
°üÀ¨°²×°Ê±ÌáʾÓÐ¹ÒÆðµÄ²Ù×÷¡¢ÊÕËõÊý¾Ý¿â¡¢Ñ¹ËõÊý¾Ý¿â¡¢×ªÒÆÊý¾Ý¿â¸øÐÂÓû§ÒÔÒÑ´æÔÚÓû§È¨ÏÞ¡¢¼ì²é±¸·Ý¼¯¡¢ÐÞ¸´Êý¾Ý¿âµÈ¡£
¡¡¡¡(Ò»)¹ÒÆð²Ù×÷
¡¡¡¡ÔÚ°²×°Sql»òsp²¹¶¡µÄʱºòϵͳÌáʾ֮ǰÓÐ¹ÒÆðµÄ°²×°²Ù×÷£¬ÒªÇóÖØÆô£¬ÕâÀïÍùÍùÖØÆôÎÞÓ㬽â¾ö°ì·¨£º
¡¡¡¡µ½HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Man ......