ÓÃsql»ñȡij×Ö·û´®ÖеÄÊý×Ö²¿·Ö
create function dbo.F_Get_No
(
@No varchar(100)
)
RETURNS bigint
AS
BEGIN
WHILE PATINDEX('%[^0-9]%',@No)>0
BEGIN
SET @No=STUFF(@No,PATINDEX('%[^0-9]%',@No),1,'') --ɾµôÒ»¸ö·ÇÊý×ÖµÄ×Ö·û£¬Ñ»·½áÊø£¬Ê£ÓàµÄΪÊý×Ö²¿·Ö
END
RETURN CONVERT(bigint,@No)
END
´Ëº¯Êý¿ÉÒÔ·µ»Øij×Ö·û´®ÖеÄÊý×Ö²¿·Ö
PATINDEXº¯Êý ·µ»ØËù²éÄÚÈÝÔÚ×Ö·û´®ÖеÚÒ»´Î³öÏÖµÄË÷Òý
STUFFº¯Êý ɾ³ýÖ¸¶¨³¤¶ÈµÄ×Ö·û²¢ÔÚÖ¸¶¨µÄÆðʼµã²åÈëÁíÒ»×é×Ö·û¡£
select F_Get_No('sdsdf2334sfsd234') ·µ»Ø'2334234'
×¢Ã÷£º´Ë·½·¨¿ÉÒÔ½â¾ö²éѯij×Ö¶ÎÖÐÊý×Ö²¿·ÖΪ¹Ì¶¨ÖµµÄ¼Ç¼£¬×Öĸ²¿·ÖΪ¶¨ÖµÀàËÆ
Ïà¹ØÎĵµ£º
String keyword = request.getParameter("keyword");
String timeRange = request.getParameter("timeRange");
String type = request.getParameter("type");
StringBuffer sql = new StringBuffer();
sql.append("use webstation_leadall s ......
MS SQL SERVER 2005È«ÎÄË÷Òýѧϰ±Ê¼ÇÒ»
ÏÈÁ˽âÒ»ÏÂÈ«ÎÄË÷ÒýÊÇÈçºÎ´´½¨ºÍʹÓõÄ
´´½¨È«ÎÄË÷Òý:
ÔÚMS SQL SERVER 2005Àï,È«ÎÄË÷ÒýÊÇÒ»¸öµ¥¶ÀµÄ·þÎñÏî,ĬÈÏÊÇÆô¶¯µÄ,µ«ÊÇûÓÐÔÊÐíÊý¾Ý¿âÆôÓÃÈ«ÎÄË÷Òý,Èç¹ûÒ ......
ÈçºÎÔÚSQLÖÐÆôÓÃÈ«ÎļìË÷¹¦ÄÜ£¿
¡¡¡¡--------------------------------------------------------------------------------
¡¡¡¡È«ÎÄË÷ÒýµÄÒ»¸öÀý×Ó£¬ÔÚ²éѯ·ÖÎöÆ÷ÖÐʹÓãº
¡¡¡¡use pubs
¡¡¡¡go
¡¡¡¡--´ò¿ªÊý¾Ý¿âÈ«ÎÄË÷ÒýµÄÖ§³Ö
¡¡¡¡execute sp_fulltext_database 'enable'
¡¡¡¡go
¡¡¡¡--½¨Á¢È«ÎÄĿ¼ft_titles
¡¡¡ ......
SQL ServerÊý¾Ý¿â²éѯËÙ¶ÈÂýµÄÔÒòÓкܶ࣬³£¼ûµÄÓÐÒÔϼ¸ÖÖ£º
1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
3¡¢Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
4¡¢ÄÚ´æ²»×ã
5¡¢ÍøÂçËÙ¶ÈÂý
6¡¢²éѯ³öµÄÊý¾ÝÁ¿¹ý´ó(¿ÉÒÔ²ÉÓöà´Î²éѯ£¬ÆäËûµÄ·½·¨½µµÍÊý¾ÝÁ¿)
7¡¢Ëø»òÕß ......