sqlserverÖÐʹÓÃÕýÔò±í´ïʽ2
ÕâÁ½ÌìÓиöÐèÇó£¬ÐèÒªÔÚÊý¾Ý¿âÖÐÅжÏ×Ö·û´®µÄ¸ñʽ£¬ÓÚÊÇ´ÓÍøÉÏËѼ¯ÁËһЩ×ÊÁÏ£¬ÕûÀíÁËһϡ£
ÏÂÃæÕâ¸öÊÇÒ»¸ö×Ô¶¨Ò庯Êý£¬Óû§¿ÉÒÔµ÷ÓÃÕâ¸öº¯ÊýÅжÏÖ¸¶¨µÄ×Ö·û´®ÊÇ·ñ·ûºÏÕýÔò±í´ïʽµÄ¹æÔò.
CREATE FUNCTION dbo.find_regular_expression
(
@source varchar(5000), --ÐèҪƥÅäµÄÔ´×Ö·û´®
@regexp varchar(1000), --ÕýÔò±í´ïʽ
@ignorecase bit = 0 --ÊÇ·ñÇø·Ö´óСд£¬Ä¬ÈÏΪfalse
)
RETURNS bit --·µ»Ø½á¹û0-false£¬1-true
AS
BEGIN
--0£¨³É¹¦£©»ò·ÇÁãÊý×Ö£¨Ê§°Ü£©£¬ÊÇÓÉ OLE ×Ô¶¯»¯¶ÔÏó·µ»ØµÄ HRESULT µÄÕûÊýÖµ¡£
DECLARE @hr integer
--ÓÃÓÚ±£´æ·µ»ØµÄ¶ÔÏóÁîÅÆ£¬ÒÔ±ãÖ®ºó¶Ô¸Ã¶ÔÏó½øÐвÙ×÷
DECLARE @objRegExp integer DECLARE @objMatches integer
--±£´æ½á¹û
DECLARE @results bit
/*
´´½¨ OLE ¶ÔÏóʵÀý,Ö»ÓÐ sysadmin ¹Ì¶¨·þÎñÆ÷½ÇÉ«µÄ³ÉÔ±²ÅÄÜÖ´ÐÐ sp_OACreate,²¢È·¶¨»úÆ÷ÖÐÓÐVBScript.RegExpÀà¿â
*/
EXEC @hr = sp_OACreate 'VBScript.RegExp', @objRegExp OUTPUT
IF @hr <> 0 BEGIN
SET @results = 0
RETURN @results
END
/*
ÒÔÏÂÈý¸ö·Ö±ðÊÇÉèÖÃн¨¶ÔÏóµÄÈý¸öÊôÐÔ¡£ÏÂÃæÊÇ'VBScript.RegExp'Öг£ÓõÄÊôÐÔ¾ÙÀý£º
Dim regEx,Match,Matches '½¨Á¢±äÁ¿¡£
Set regEx = New RegExp '½¨Á¢Ò»°ã±í´ïʽ¡£
regEx.Pattern= patrn 'ÉèÖÃģʽ¡£
regEx.IgnoreCase = True 'ÉèÖÃÊÇ·ñÇø·Ö´óСд¡£
regEx.Global=True 'ÉèÖÃÈ«¾Ö¿ÉÓÃÐÔ¡£
set Matches=regEx.Execute(string)
Ïà¹ØÎĵµ£º
ÎÒÔÚ°ÑoracleÊý¾Ýµ¼ÈësqlserverÖÐʱ£¬·¢ÏÖÔÚoracleÖÐ×ֶζ¨ÒåΪΨһË÷Òýʱ£¬²»Í¬¼Ç¼µÄ´Ë×Ö¶ÎÈç¹ûΪ¿Õ²»±»ÈÏΪÊÇÖØ¸´µÄ£¬µ«ÔÚsqlserverÖÐÈç¹û´Ë×Ö¶ÎΪΨһË÷Òý×ֶΣ¬²»ÔÊÐíÓÐ2¸öÒÔÉϵĿÕÖµ¡£ÓôÃÆ¡£ËùÒÔÖ»ºÃ½«sqlserverÖеÄΨһË÷Òý×Ö¶ÎÊÖ¹¤ÐÞ¸ÄΪ¼¸¸ö·Ç¿ÕµÄÖµ£¬µ«ÕâÑù³ÌÐò¿Ï¶¨Òª½øÐÐÐÞ¸ÄÁË¡£ÐèÒªÔÚ³ÌÐòÖÐΪ´Ë×Ö¶ÎÉèÖò»Öظ´ ......
1.Èç¹ûÏÈprepare ºóÌí¼Ó²ÎÊý£¬ÕâÑùÒ»²¿·ÖÊý¾ÝÀàÐÍ¿ÉÒÔ²»ÓÃÉèÖÃÆäsize´óС£¬ÀýÈçchar
2.Èç¹ûÏÈÌí¼Ó²ÎÊýÔÙprepare£¬¾Í±ØÐëÉèÖòÎÊýµÄÀàÐÍ£¬´óС£¬¾«¶È²ÅÄÜͨ¹ý£¬±ÈÈçchar,varchar,decimalÀàÐÍ£¬¶øint,floatÓй̶¨×Ö½ÚÀàÐ͵ÄÊý¾ÝÀàÐÍÔò¿É²»ÓÃÉèÖôóС¡£
3.¹ØÓÚSqlServerµÄtimestampÀàÐÍ£º¸ÃÀàÐÍΪSqlServerµÄʱ¼ä´ÁÀàÐÍ£¬´´½ ......
EXEC sp_addlinkedsrvlogin @rmtsrvname = 'serverontest', @useself = 'false', @locallogin = 'sa', @rmtuser = 'sa', @rmtpassword = 'passwordofsa'
Ìí¼ÓµÇ¼·½Ê½
ÒÔÉÏÁ½¸öÓï¾äÖУ¬@serverΪ·þÎñÆ÷µÄ±ðÃû£¬@datasrcΪҪÁ´½ÓµÄÄ¿±êÊý¾Ý¿âµÄÁ¬½Ó´®£¬@rmtsrvnameΪ±ðÃû,@localloginΪ±¾µØµÇ¼µÄÓû§Ãû£¬@rmtuserºÍ@rmtpa ......
declare @areaid varchar(100)
declare @areaname varchar(100)
declare Cur cursor for
select code as areaID,[name] as areaName from dbo.province
open Cur
Fetch next from Cur Into @areaid,@areaname
While @@fetch_status=0
Begin
print('insert into ......
Ê×ÏÈ£¬×öÒ»µã˵Ã÷¡£FlexÊDz»ÄÜÖ±½ÓÁ¬½ÓÊý¾Ý¿âµÄ£¬ÕâÒ»µã´ó¼ÒÐèÒªÖªµÀ£¬ËüÖ»Äܼä½ÓµØÁ¬½ÓÊý¾Ý¿â¡£FlexÖÐÌṩÁËÈýÖÖ·½Ê½£ºHttpService£¬WebService ºÍRemoteObject¡£ÆäÖÐHttpService¿ÉÒÔÖ±½Ó»ñÈ¡XMLÖеÄÊý¾Ý£¬»¹¿ÉÒÔͨ¹ýJSP,ASPÒÔ¼°PHP¶ÁÈ¡Êý¾Ý¿âÖеÄÊý¾Ý£¬Õâ¸ö±È½Ï¼òµ¥£¬¶øÇÒÍøÉÏÒ²ÓкܶàÀý×Ó£¬ÎҾͲ»¶à˵ÁË¡£WebServiceÎÒ²» ......