Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÈçºÎÔÚSQLÖÐÆôÓÃÈ«ÎļìË÷¹¦ÄÜ

ÈçºÎÔÚSQLÖÐÆôÓÃÈ«ÎļìË÷¹¦ÄÜ£¿
¡¡¡¡--------------------------------------------------------------------------------
¡¡¡¡È«ÎÄË÷ÒýµÄÒ»¸öÀý×Ó£¬ÔÚ²éѯ·ÖÎöÆ÷ÖÐʹÓãº
¡¡¡¡use pubs
¡¡¡¡go
¡¡¡¡--´ò¿ªÊý¾Ý¿âÈ«ÎÄË÷ÒýµÄÖ§³Ö
¡¡¡¡execute sp_fulltext_database 'enable'
¡¡¡¡go
¡¡¡¡--½¨Á¢È«ÎÄĿ¼ft_titles
¡¡¡¡execute sp_fulltext_catalog 'ft_titles', 'create'
¡¡¡¡go
¡¡¡¡--Ϊtitles±í½¨Á¢È«ÎÄË÷ÒýÊý¾ÝÔª£¬UPKCL_titleidindÊÇÖ÷¼üËù½¨Á¢µÄΨһË÷Òý£¬¿ÉÓÉsp_help titlesµÃÖª
¡¡¡¡execute sp_fulltext_table 'titles','create', 'ft_titles', 'UPKCL_titleidind'
¡¡¡¡go
¡¡¡¡--ÉèÖÃÈ«ÎÄË÷ÒýÁÐÃû
¡¡¡¡exec sp_fulltext_column 'titles', 'title', 'add'
¡¡¡¡go
¡¡¡¡exec sp_fulltext_column 'titles', 'notes', 'add'
¡¡¡¡go
¡¡¡¡--½¨Á¢È«ÎÄË÷Òý
¡¡¡¡exec sp_fulltext_table 'titles', 'activate'
¡¡¡¡go
¡¡¡¡--Ìî³äÈ«ÎÄË÷ÒýĿ¼
¡¡¡¡exec sp_fulltext_catalog 'ft_titles', 'start_full'
¡¡¡¡go
¡¡¡¡--ʹÓÃcontainsºÍfreetext
¡¡¡¡select title, notes from titles
¡¡¡¡where contains(title, '"computer Cooking"')
¡¡¡¡go
¡¡¡¡select title, notes from titles
¡¡¡¡where freetext(title, 'computer Cooking')
¡¡¡¡go
¡¡¡¡select title, notes from titles
¡¡¡¡where freetext(title, '"computer Cooking"')
¡¡¡¡go
¡¡¡¡select title, notes from titles
¡¡¡¡where contains(title, 'computer')
¡¡¡¡go
¡¡¡¡select title, notes from titles
¡¡¡¡where freetext (*, 'computer')
¡¡¡¡go
------------------------------------------------------------------------------------------------------
ʾÀý
SQL SERVERÊý¾Ý¿âÈ«ÎÄË÷ÒýµÄʾÀý£¬ÒÔpubsÊý¾Ý¿âΪÀý¡£
Ê×ÏÈ£¬½éÉÜÀûÓÃϵͳ´æ´¢¹ý³Ì´´½¨È«ÎÄË÷ÒýµÄ¾ßÌå²½Ö裺
1) Æô¶¯Êý¾Ý¿âµÄÈ«ÎÄ´¦Àí¹¦ÄÜ (sp_fulltext_database)
2) ½¨Á¢È«ÎÄĿ¼ (sp_fulltext_catalog)
3) ÔÚÈ«ÎÄĿ¼ÖÐ×¢²áÐèҪȫÎÄË÷ÒýµÄ±í (sp_fulltext_table)
4) Ö¸³ö±íÖÐÐèҪȫÎÄË÷ÒýµÄÁÐÃû (sp_fulltext_column)
5) Ϊ±í´´½¨È«ÎÄË÷Òý (sp_fulltext_table)
6) Ìî³äÈ«ÎÄĿ¼ (sp_fulltext_catalog)
---------********ʾÀý********-------------
ÒÔ¶ÔpubsÊý¾Ý¿âµÄtitleºÍnotesÁн¨Á¢È«ÎÄË÷Òý£¬Ö®ºóʹÓÃË÷Òý²éѯtitleÁлònotesÁÐÖаüº¬ÓÐdatebase »òcomputer×Ö·û´®µÄͼÊéÃ


Ïà¹ØÎĵµ£º

SQLµ±Ç°ÈÕÆÚ»ñÈ¡¼¼ÇÉ

SQLµ±Ç°ÈÕÆÚ»ñÈ¡¼¼ÇÉ
select   getdate()   //2003-11-07   17:21:08.597    
  select   convert(varchar(10),   getdate(),120)   //2003-11-07  
  select   convert(char(8),getdate(),112)  ......

C#µ÷ÓÃSQL´æ´¢¹ý³ÌÒÔ¼°·µ»ØÖµºÍ²ÎÊýµÄ»ñÈ¡

QZone Editor
.dump{}

//TODO ÓòÃû
if (location.hash) {
document.domain=location.hash.substr(1);
}

//parent.qZEditor.callback();
function init(){
//»ñÈ¡±à¼­Æ÷Ãæ°åID
var pid = frameElement.panelID;

//»ñÈ¡±à¼­Æ÷Ãæ°å¶ÔÏó ......

sqlÊÂÎñ´¦Àí


 
BEGIN TRANSACTION--¿ªÊ¼ÊÂÎñ
DECLARE @errorSun INT --¶¨Òå´íÎó¼ÆÊýÆ÷
SET @errorSun=0 --û´íΪ0
UPDATE a SET id=232 WHERE a=1 --ÊÂÎñ²Ù×÷SQLÓï¾ä
SET @errorSun=@errorSun+@@ERROR --ÀÛ¼ÆÊÇ·ñÓдí
UPDATE aa SET id=2 WHERE a=1 --ÊÂÎñ²Ù×÷SQLÓï¾ä
SET @errorSun=@errorSun+@@ERROR --ÀÛ¼ÆÊÇ·ñÓдí
I ......

SQLÖг£Óú¯ÊýµÄÕûÀí

¶ÔÓÚsqlÖеĺ¯Êý¿ÉνÊǶàµÄ²»Ê¤Ã¶¾Ù£¬±¾ÎÄ´Ó³£Óú¯ÊýµÄ½Ç¶È¶ÔÆäº¯Êý½øÐÐ×ܽ᣺1¡¢ÈÕÆÚºÍʱ¼äº¯Êý2¡¢×Ö·û´®º¯Êý3¡¢ÏµÍ³º¯ÊýÁ÷³Ì¿ØÖÆÓï¾ä
1¡¢  ÈÕÆÚºÍʱ¼äº¯Êý
¶ÔÓÚÈÕÆÚº¯ÊýÎÒÃÇ¿ÉÒÔ·ÖΪ2СÀà½øÐзÖÎö´¦Àí£¬
A¡¢ ÈÕÆÚµÄÕûÌå´¦Àíº¯Êý£¬¾ßÌåµÄº¬ÒåºÍÓï·¨ÈçÏÂËùʾ£º
DATEADD(datepart,number,date)
µÚÒ»¸ö²ÎÊý˵Ã÷ÒªÌí ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ