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

mssql ÁÐÄÚÊý¾ÝºáÏòÁ¬½Ó,ÓöººÅ·Ö¸î¡£

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[temp_Table]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[temp_Table]
GO
CREATE TABLE [dbo].[temp_Table] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[productname] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL 
) ON [PRIMARY]
GO
insert into temp_table select column from  table
declare @i int,@c int,@string varchar(5000),@j varchar(5000)
DECLARE   @SQLString   NVARCHAR(5000)
select @SQLString=N'select @c = count(*) from temp_table'
execute  sp_executesql  @sqlstring,
N'@c int output',
@c=@c output
set @i=1
set @string=''
while @i<=@c
begin
select @SQLString=N'select @j = productname from temp_table where id = '+cast(@i as varchar(5))
execute  sp_executesql  @sqlstring,
N'@j varchar(5000) output',
@j=@j output
select @string =@string + @j + ','
select @i=@i+1
end
select substring(@string,0,len(@string)-1)
drop table temp_table


Ïà¹ØÎĵµ£º

MsSqlÄÚ²¿ÐÅÏ¢(Áôµµ)

--SCHEMATA±íÌṩÁ˹ØÓÚÊý¾Ý¿âµÄÐÅÏ¢
select top 10 * from INFORMATION_SCHEMA.SCHEMATA
--TABLES±í¸ø³öÁ˹ØÓÚÊý¾Ý¿âÖеıíµÄÐÅÏ¢
select top 10 * from INFORMATION_SCHEMA.TABLES
--COLUMNS±í¸ø³öÁ˱íÖеÄÁÐÐÅÏ¢¡£
select top 10 * from INFORMATION_SCHEMA.COLUMNS
--VIEWS±í¸ø³öÁ˹ØÓÚÊý¾Ý¿âÖеÄÊÓͼµÄÐÅÏ¢
sel ......

MSSQLÈÕÖ¾Îļþ¼°Æä´¦ÀíÏê½â


ÈçºÎÇå³ýMSSQLÊÂÎñÈÕÖ¾Îļþ
   ÈýÖÖ·½·¨£º  
    
1¡¢É¾³ýLOG  
    
   1)£º·ÖÀëÊý¾Ý¿âÆóÒµ¹ÜÀíÆ÷£­£¾·þÎñÆ÷£­£¾Êý¾Ý¿â£­£¾ÓÒ¼ü£­£¾·ÖÀëÊý¾Ý¿â      
   2)£ºÉ¾³ýLOGÎļþ  & ......

MSSQLÓÅ»¯Ö®Ë÷ÒýÓÅ»¯

Ò»¡¢ÈÏʶË÷Òý
¡¡¡¡(Ò»)ÉîÈëdz³öÀí½âË÷Òý½á¹¹
¡¡¡¡Êµ¼ÊÉÏ£¬Äú¿ÉÒÔ°ÑË÷ÒýÀí½âΪһÖÖÌØÊâµÄĿ¼¡£Î¢ÈíµÄSQL SERVERÌṩÁËÁ½ÖÖË÷Òý£º¾Û¼¯Ë÷Òý(clustered index£¬Ò²³Æ¾ÛÀàË÷Òý¡¢´Ø¼¯Ë÷Òý)ºÍ·Ç¾Û¼¯Ë÷Òý(nonclustered index£¬Ò²³Æ·Ç¾ÛÀàË÷Òý¡¢·Ç´Ø¼¯Ë÷Òý)¡£ÏÂÃæ£¬ÎÒÃǾÙÀýÀ´ËµÃ÷һϾۼ¯Ë÷ÒýºÍ·Ç¾Û¼¯Ë÷ÒýµÄÇø±ð£º
¡¡¡¡Æäʵ£¬ÎÒà ......

MSSQLÈ«ÎļìË÷

MSSQLÈ«ÎļìË÷ --1.´ò¿ªÊý¾Ý¿â
use pubs
go
--2.´ò¿ªÈ«ÎÄË÷ÒýÖ§³Ö
--execute sp_fulltext_database 'enable'
/*
£¨ËùÓ°ÏìµÄÐÐÊýΪ 1 ÐУ©
£¨ËùÓ°ÏìµÄÐÐÊýΪ 0 ÐУ©
£¨ËùÓ°ÏìµÄÐÐÊýΪ 1 ÐУ©
*/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ