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

SQL SERVERÐÔÄÜÓÅ»¯ TempdbÏà¹ØÎÊÌâ

TEMPDB²»Ö§³Ö×Ô¶¯Ñ¹Ëõ£¬ÇÒËüµÄÊý¾Ý¿âºÍÎļþѹËõÄÜÁ¦ÊÇÓÐÏÞÖÆµÄ£»
Èç²»µÃ²»Ñ¹ËõTEMPDBµÄ´óС£¬½¨ÒéʹÓÃÀëÏß¹¦ÄÜ£¬ÈçϲÙ×÷£º
1.Í£Ö¹SQL SERVER·þÎñ£»
2.ÕÒµ½sqlservr.exeÔÚ´ÅÅÌÖеÄλÖã»
3.ʹÓÃsqlservr.exeÊäÈëÃüÁîsqlservr -c -f,ÕâÑùÆô¶¯SQL SERVERʱ£¬TEMPDBµÄ´óСÄܹ»±£³Ö×îС£»
4.ʹÓÃTSQLÃüÁALTER DATABASE TEMPDB MODIFY FILE£¨£©£¬ÕâÑù¾Í¿ÉÒԸıäTEMPDBµÄ´óС£»
5.ÖØÆôSQL SERVER·þÎñ£»
TEMPDB¿Õ¼äÓÐÈýÖÖ¶ÔÏó--Óû§¶ÔÏó¡¢ÄÚ²¿¶ÔÏóÒÔ¼°°æ±¾´æ´¢¶ÔÏó£»
Óû§¶ÔÏó£º
Óû§¶¨ÒåµÄ±¾µØÁÙʱ±íÖÐÁÙʱʹÓõĶÔÏó£»
Àý£ºselect * from sys.all_objects
ÄÚ²¿¶ÔÏó£º
·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······150
declare @i int 
set @i = 0  
create table #myTempTable (keycolumn int, mybigCharColumn char (1000) )  
while (@i < 1000000)  
begin  
insert into #myTempTable values(@i,'x' )  
set @i = @i + 1  
end  
select * from #myTempTable  
order by keycolumn 
declare @i int
set @i = 0
create table #myTempTable (keycolumn int, mybigCharColumn char (1000) )
while (@i < 100000


Ïà¹ØÎĵµ£º

sqlÓïÑÔ£ºÈçºÎÅжÏ×Ö¶ÎÊÇ·ñ´æÔÚ£¬ÈçºÎɾ³ý¼°´´½¨×Ö¶Î

ÈçºÎÅжÏ×Ö¶ÎÊÇ·ñ´æÔÚ
 if col_length('±íÃû','×Ö¶Î1') is null  ALTER TABLE ±íÃû ADD ×Ö¶Î1 Nvarchar(50)  if col_length('±íÃû','×Ö¶Î2') is null  ALTER TABLE ±íÃû ADD ×Ö¶Î2 Nvarchar(50) ");
ɾ³ý×Ö¶Î
if col_length('±íÃû','×Ö¶Î1,') is not null  ALTER TABLE ±íÃû drop  c ......

SQLµÄ·ÖÒ³²éѯ

·ÖÒ³²éѯµÄÔ­Àí£º
 Õâ¸öÖ»ÄÜÓÃÔÙSql2005¼°ÒÔÉϵİ汾
DECLARE @pagenum AS INT, @pagesize AS INT  
SET @pagenum = 2   
SET @pagesize = 3   
SELECT *   
from (SELECT ROW_NUMBER()&n ......

SQL ΪÖ÷±íµÄıһÌõ¼Ç¼£¬ÔÚÖмä±íÖÐͬʱ²åÈë¶àÌõÊý¾Ý

ÓÐʱÎÒÃÇ»áÏñÏÂÃæµÄÇé¿öÒ»Ñù£¬ÎªÖ÷±íµÄıһÌõ¼Ç¼£¬ÔÚÖмä±í(T_Stud_Course ±í)ÖÐͬʱ²åÈë¶àÌõÊý¾Ý
T_Student ±í
Stud_ID
Name
1
Tom
2
Jack
T_Course ±í
Course_ID
Course
1
Chinese
2
English
T_Stud_Course ±í
ID
Stud_ID
Course_ID
1
1
1
2
1
2
3
2
2
 
ÏÖÔÚÎÒÃÇ¿ÉÒÔÏÂÃæµÄ´æ´¢¹ý³ÌÀ ......

SQL 2005 ´æ´¢¹ý³Ì µ÷ÊÔ

SQL 2005 µÄ´æ´¢¹ý³ÌºÍ´¥·¢Æ÷µ÷ÊԴ󷨣¨Ô­´´£©
www.chengchen.net ³Ì³¿
       ×òÌìÍíÉÏÎÒÕÒ±éÁË»¥ÁªÍøÒ²Ã»Óз¢ÏÖ¹ØÓÚSQL2005´æ´¢¹ý³ÌºÍ´¥·¢Æ÷µÄµ÷ÊÔ·½·¨£¬Ñо¿µ½Á賿2µã¶àÖÓ£¬ÖÕÓÚÕÒµ½·½·¨ÁË£¬²»¸É¶ÀÏí£¬ÄóöÀ´·ÖÏí¡£Èç¹ûÒª×ªÔØ£¬Çë±£Áô°æÈ¨£¬Ð»Ð»£¡
     &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ