SQL Server CLRÈ«¹¦ÂÔÖ®ËÄ
CLR¿ÉÒÔʵÏÖDMLºÍDDLÁ½ÖÖ´¥·¢ÐÎʽ£¬µ«ÊDZ¾ÈËÒ»°ã²»½¨ÒéʹÓÃCLRµÄ´¥·¢Æ÷£¬Ö÷ÒªÊÇ¿¼Âǵ½Ð§ÂÊÎÊÌâ¡£±ÈÈçÎÒÃÇʹÓÃtriggerÀ´ÊµÏÖ·¢mailµÈ²Ù×÷ʱ£¬¾ÍÒª¿¼ÂÇpop3»òÊÇsmtpµÈ´ýʱ¼ä£¬ÒòΪtrigger±¾Ê¾ÍÊǸöÊÂÎñ£¬Ò²¾ÍÊÇ˵£¬ÔÚsmtpµÈ´ýʱ¼äÒ²ËãÔÚÁËÕû¸öÊÂÎñÖУ¬ÕâÑù¾Í»á´ó´óÓ°ÏìЧÂÊ¡£
1.CLR DML´¥·¢Æ÷
DMLÖ¸µÄÊÇÊý¾Ý²Ù×÷ÓïÑÔ£¬Ò²¾ÍÊÇͨ³£µÄinsert,updateºÍdelete²Ù×÷¡£Õâ¸ö´¥·¢Æ÷Ö÷ҪʵÏÖÔÚ¶ÔpubsÊý¾Ý¿âÖеÄauthor±í½øÐÐinsert,update,deleteʱ£¬»áÏÔʾÏàÓ¦µÄ²Ù×÷Ãû³Æ¡£
///
/// °Ñinsert,update,delete²Ù×÷¶¼ÏÔʾ³öÀ´
///
[Microsoft.SqlServer.Server.SqlTrigger(
Name = "UF_DML_Trigger",
Target = "dbo.authors",
Event = "FOR INSERT, UPDATE, DELETE")]
public static void UF_DML_Trigger()
{
switch (SqlContext.TriggerContext.TriggerAction)
{
case TriggerAction.Insert:
SqlContext.Pipe.Send("Trigger Insert");
break;
case TriggerAction.Update:
SqlContext.Pipe.Send("Trigger Update");
break;
case TriggerAction.Delete:
SqlContext.Pipe.Send("Trigger Delete");
Ïà¹ØÎĵµ£º
1) ʱ¼äת»»º¯ÊýÖÐÈç¹ûÓÐʱ¼ä±äÁ¿yyyy-mm-ddÁ½±ßÐèÁ½''
to_date(''' || to_char(a_valid_date_end, 'yyyy-mm-dd') ||''', ''yyyy-mm-dd'')
2) select distinct(e.itemnum) bulk collect into v_itemnum
½«×Ö·û´®Êý×éÒÔ·Ö¸ô·û·Ö¸ôµÄ×Ö·û´®µ÷ÓÃ
pkg_maximo_common.get_string(v_itemnum, ',', '')
3) unionÖ»Êǽ«Á½¸ö½á¹ ......
1. >>¼ÓÃÜ
from the Books Online:
Use the WITH ENCRYPTION option:
IF EXISTS (SELECT name from sysobjects
WHERE name = 'encrypt_this' AND type = 'P')
DROP PROCEDURE encrypt_this
GO
USE pubs
GO
CREATE PROCEDURE encrypt_this
WITH ENCRYPTION
AS
SELECT *
from authors
GO
EXEC sp ......
ÊÓͼµÄ´´½¨¼°Ê¹ÓÃ(sql server 2005)
´´½¨Ò»¸öÐéÄâ±í£¬¸Ã±íÒÔÒ»ÖÖ±¸Ó÷½Ê½Ìṩһ¸ö»ò¶à¸ö±íÖеÄÊý¾Ý¡£CREATE VIEW ±ØÐëÊDzéѯÅú´¦ÀíÖеĵÚÒ»ÌõÓï¾ä¡£
Transact-SQL Óï·¨Ô¼¶¨
Óï·¨
CREATE VIEW [ schema_name . ] view_name [ (column [ ,...n ] ) ]
[ WITH <view_attribute> [ ,...n ] ]
AS s ......
´ÓAccessÊý¾Ý¿âµ¼Èëµ½SQL
·½·¨Ò»:
ÔÚMSsqlÖÐÒª¼òÀúODBC..·½·¨±È½Ï±¿µã..
·½·¨¶þ:
Ö±½Ó´ÓAccessÉýǨµ½MSsql..
ÒòΪAccessÊý¾Ý¿âÓÐÉèÖÃÃÜÂë..»¹Õæ²»ºÃ¸ã..¸ãÁ˺ü¸´Î¶¼Ê§°ÜÁË..
ÀûÓ÷½·¨¶þ..Ò»´Î³É¹¦..
ÓÃÊý¾Ý¿âÉýǨ...¼òµ¥...
½¨ÒéʹÓõڶþÖÖ·½·¨µ¼ÈëACCESSÊý¾Ý¿âµ½MSSQLÊý¾Ý¿âÖÐ..Ê¡ÊÂ!!! ......