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

sql È«ÎÄË÷Òý

1¡¢ÒªÆôÓÃÈ«ÎÄË÷Òý¹¦ÄÜÊ×ÏÈÐèÒª°²×°full text searchÈ«ÎÄË÷Òý·þÎñ
2¡¢Æô¶¯full text search·þÎñ
3¡¢ÏÈ´´½¨UniqueË÷ÒýºÍÈ«ÎÄË÷Òý£ºCREATE FULLTEXT INDEX ON table_name
4¡¢Ã¿¸ö±íÖ»ÔÊÐí´´½¨Ò»¸öÈ«ÎÄË÷Òý
ɾ³ýÈ«ÎÄË÷Òý DROP FULLTEXT INDEX ON table_name
È«ÎÄËÑË÷Óï¾ä£¬contains(),freeText()
×¢ÒâÊý¾Ý¿âµÄÅÅÐò¹æÔò£¬Chinese_PRC_CI_ASʱÖÐÎIJſɲéѯµ½ÕýÈ·½á¹û¡£
5¡¢Ê¾ÀýÓï¾ä£º
 
--¿ªÆôÊý¾Ý¿âÈ«ÎÄË÷Òý
SP_FULLTEXT_DATABASE 'enable'
--´´½¨±í
CREATE TABLE [dbo].[UserTB](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [fullname] [nvarchar](400) COLLATE Chinese_PRC_CI_AS NULL,
    [address] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
 
--дÈë²âÊÔÊý¾Ý
insert into usertb(fullname,address) values('ÀÏÖÜ','»ØÁú¹ÛµØÇø±±¾©²ýƽ');
insert into usertb(fullname,address) values('ÀÏÍõ','beijing city changping district hui long guan region');
insert into usertb(fullname,address) values('ÀÏÀî','beijingcitychangpingdistricthuilongguan region');
insert into usertb(fullname,address) values('ÀÏÆÅ','aaaaaaaaaa dddddddd');
--´´½¨Ë÷Òý
CREATE UNIQUE INDEX    ix_usertb_id ON usertb(id)
--´´½¨È«ÎÄË÷ÒýĿ¼
CREATE FULLTEXT CATALOG fa AS DEFAULT
--DROP FULLTEXT CATALOG FA
--CREATE FULLTEXT INDEX ON dbo.usertb(fullname) KEY INDEX ix_usertb_id 
--DROP FULLTEXT INDEX on usertb
--´´½¨È«ÎÄË÷Òý
CREATE FULLTEXT INDEX ON dbo.usertb(address) KEY INDEX ix_usertb_id 
--²âÊÔ²éѯ
SELECT * from userTB
--WHERE CONTAINS(address,'changpin')
--WHERE CONTAINS(address,'changping')
WHERE CONTAINS(address,'"aaa*"')
--WHERE CONTAINS(address,'"²ýƽ*"')
--WHERE CONTAINS(address,'²ýƽ')


Ïà¹ØÎĵµ£º

Ò»¸ösql¼òµ¥º¯ÊýʵÏÖÆ´½Ó×Ö·û´®

--²âÊÔÊý¾Ý
create table table1(AID int,NAME nvarchar(20))
create table table2 (BID int,NUMBER nvarchar(20))
insert into table1 select 1,'Tom' union all
select 2,'Jim'
insert into table2 select 1,20 union all
select 1,30
--º¯Êý
create function F_Str(@ID int)
returns nvarchar(100)
as
begin ......

SQL ServerÖÐÔ¼ÊøµÄ½éÉÜ

ÕªÒª
¶ÔÓÚSQL ServerÖеÄÔ¼Êø£¬Ïë±Ø´ó¼Ò²¢²»ÊǺÜÄ°Éú¡£µ«ÊÇÔ¼ÊøÖÐÕæÕýµÄÄÚº­ÊÇʲô£¬²¢²»ÊǺܶàÈ˶¼ºÜÇå³þµÄ¡£±¾ÎÄÒÔÏêϸµÄÎÄ×ÖÀ´½éÉÜÁËʲôÊÇÔ¼Êø£¬ÒÔ¼°ÈçºÎÔÚÊý¾Ý¿â±à³ÌÖÐÓ¦ÓúÍʹÓÃÕâЩԼÊø£¬À´´ïµ½¸üºÃµÄ±à³ÌЧ¹û¡££¨±¾ÎIJ¿·ÖÄÚÈݲο¼ÁËSQL ServerÁª»úÊֲᣩ
ÄÚÈÝ
 
Êý¾ÝÍêÕûÐÔ·ÖÀà
 
ʵÌåÍêÕûÐÔ
&nb ......

SQL 2005ת»»³É2000 (SQL Server)


Ö±½Órestore»ò¸½¼ÓÓ¦¸ÃÊDz»ÐеÄ, Óýű¾+µ¼Êý¾Ý¿Ï¶¨Ã»ÓÐÎÊÌâ¡£
2005תµ½2000µÄ²½Öè
1. Éú³Éfor 2000°æ±¾µÄÊý¾Ý¿â½Å±¾
2005 µÄmanger studio
-- ´ò¿ª"¶ÔÏó×ÊÔ´¹ÜÀíÆ÷"(ûÓеĻ°°´F8), Á¬½Óµ½ÄãµÄʵÀý
-- ÓÒ¼üҪתµ½2000µÄ¿â
-- ÈÎÎñ
-- Éú³É½Å±¾
-- ÔÚ"½Å±¾Ïòµ¼"µÄ"Ñ¡ÔñÊý¾Ý¿â"ÖÐ, ......

SQL´æ´¢¹ý³Ì²âÊÔ£¨5£©——´ÓT

ÎÊÌâ
      ÈçºÎÈÃT-SQL²âÊÔÌ×¼þ°Ñ²âÊÔÓÃÀý½á¹ûÖ±½ÓдÈëÎı¾Îļþ
Éè¼Æ
      ʹÓÃActiveX¼¼ÊõʵÀý»¯Ò»¸öFileSystemObject¶ÔÏó£¬È»ºóͨ¹ýOpenTextFile()ºÍWriteLine()·½·¨Ö±½Ó°Ñ²âÊÔ½á¹ûдÈëÎļþ¡£
·½°¸
declare @fsoHandle int,@fileID int
exec sp_OACreate 'Scr ......

SQL Server2005 ±í·ÖÇøÈý²½Çú

Ç°ÑÔ
SQL Server 2005¿ªÊ¼Ö§³Ö±í·ÖÇø£¬ÕâÖÖ¼¼ÊõÔÊÐíËùÓеıí·ÖÇø¶¼±£´æÔÚͬһ̨·þÎñÆ÷ÉÏ¡£Ã¿Ò»¸ö±í·ÖÇø¶¼ºÍÔÚij¸öÎļþ×é(filegroup)Öеĵ¥¸öÎļþ¹ØÁª¡£Í¬ÑùµÄÒ»¸öÎļþ/Îļþ×é¿ÉÒÔÈÝÄɶà¸ö·ÖÇø±í¡£ÔÚÕâÖÖÉè¼Æ¼Ü¹¹Ï£¬Êý¾Ý¿âÒýÇæÄܹ»Åж¨²éѯ¹ý³ÌÖÐÓ¦¸Ã·ÃÎÊÄĸö·ÖÇø£¬¶ø²»ÓÃɨÃèÕû¸ö±í¡£Èç¹û²éѯÐèÒªµÄÊý¾ÝÐзÖÉ¢ÔÚ¶à¸ö·ÖÇøÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ