Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sql

SQL SERVER

DBCC
Transact-SQL ±à³ÌÓïÑÔÌṩ DBCC Óï¾ä×÷Ϊ Microsoft® SQL Server™ 2000 µÄÊý¾Ý¿â¿ØÖÆ̨ÃüÁî¡£ÕâЩÓï¾ä¶ÔÊý¾Ý¿âµÄÎïÀíºÍÂß¼­Ò»ÖÂÐÔ½øÐмì²é¡£Ðí¶à DBCC Óï¾äÄܹ»¶Ô¼ì²âµ½µÄÎÊÌâ½øÐÐÐÞ¸´¡£
Êý¾Ý¿â¿ØÖÆ̨ÃüÁîÓï¾ä±»·ÖΪÒÔÏÂÀà±ð¡£
Óï¾ä·ÖÀà Ö´ÐÐ
ά»¤Óï¾ä ¶ÔÊý¾Ý¿â¡¢Ë÷Òý»òÎļþ×é½øÐÐά»¤µÄÈÎÎñ¡£ 
ÔÓÏîÓï¾ä ÖîÈçÆôÓÃÐм¶Ëø¶¨»ò´ÓÄÚ´æÖÐɾ³ý¶¯Ì¬Á´½Ó¿â (DLL) µÈÔÓÏîÈÎÎñ¡£
״̬Óï¾ä ״̬¼ì²é¡£
ÑéÖ¤Óï¾ä ¶ÔÊý¾Ý¿â¡¢±í¡¢Ë÷Òý¡¢Ä¿Â¼¡¢Îļþ×顢ϵͳ±í»òÊý¾Ý¿âÒ³µÄ·ÖÅä½øÐеÄÑéÖ¤²Ù×÷¡£
SQL Server 2000 µÄ DBCC Óï¾äʹÓÃÊäÈë²ÎÊýºÍ·µ»ØÖµ¡£ËùÓÐ DBCC Óï¾ä²ÎÊý¶¼¿ÉÒÔ½ÓÊÜ Unicode ºÍ DBCS ×ÖÃæÖµ¡£
ʹÓà DBCC ½á¹û¼¯Êä³ö
Ðí¶à DBCC ÃüÁî¿ÉÒÔ²úÉú±í¸ñ¸ñʽµÄÊä³ö£¨Ê¹Óà WITH TABLERESULTS Ñ¡Ï¡£¸ÃÐÅÏ¢¿É×°Ôص½±íÖÐÒԱ㽫À´Ê¹Óá£ÒÔÏÂÏÔʾһ¸öʾÀý½Å±¾£º
-- Create the table to accept the results
CREATE TABLE #tracestatus (
   TraceFlag INT,
   Status INT
   )
-- Execute the command, putting the results in the table
INSERT INTO #tracestatus
   EXEC ('DBCC TRACESTATUS (-1) ......

SQL ServerÎÞ·¨´ò¿ªÓû§Ä¬ÈÏÊý¾Ý¿â

ÎÞ·¨´ò¿ªÓû§Ä¬ÈÏÊý¾Ý¿â£¬µÇ¼ʧ°Ü,ÕâÊÇSQL ServerʹÓÃÕßÊìϤµÄÎÊÌâÖ®Ò»¡£ÔÚʹÓÃÆóÒµ¹ÜÀíÆ÷¡¢²éѯ·ÖÎöÆ÷¡¢¸÷À๤¾ßºÍÓ¦ÓÃÈí¼þµÄʱºò£¬Ö»Òª¹Øϵµ½Á¬½ÓSQL ServerÊý¾Ý¿âµÄʱºò£¬¶¼ÓпÉÄÜ»áÅöµ½´ËÎÊÌâ,ÒýÆð´Ë´íÎó·¢ÉúµÄÔ­Òò±È½Ï¶à,ÏÂÃæÎÒÃǾÍÀ´Ïêϸ·ÖÎöÒýÆð´ËÎÊÌâµÄÔ­ÒòÒÔ¼°½â¾ö°ì·¨¡£
Ò»¡¢Ô­Òò
µÇ¼ÕÊ»§µÄĬÈÏÊý¾Ý¿â±»É¾³ý¡£
¶þ¡¢½â¾ö·½·¨£º
(Ò»)¡¢Ê¹ÓùÜÀíÔ±ÕÊ»§Ð޸ĴËÕÊ»§µÄĬÈÏÊý¾Ý¿â
1¡¢´ò¿ªÆóÒµ¹ÜÀíÆ÷,Õ¹¿ª·þÎñÆ÷×é,È»ºóÕ¹¿ª·þÎñÆ÷
2. Õ¹¿ª"°²È«ÐÔ",Õ¹¿ªµÇ¼£¬ÓÒ»÷ÏàÓ¦µÄµÇ¼ÕÊ»§£¬´Óµ¯³öµÄ²Ëµ¥ÖÐÑ¡Ôñ£¬ÊôÐÔ
3¡¢ÖØÐÂÑ¡Ôñ´ËµÇ¼ÕÊ»§µÄĬÈÏÊý¾Ý¿â
(¶þ)¡¢ÈôûÓÐÆäËû¹ÜÀíÔ±µÇ¼ÕÊ»§£¬ÎÞ·¨ÔÚÆóÒµ¹ÜÀíÆ÷ÀïÐ޸ģ¬Ê¹ÓÃisqlÃüÁîÐй¤¾ß
isql /U"sa" /P"saµÄÃÜÂë" /d"master" /Q"exec sp_defaultdb N'sa', N'master'"
Èç¹ûʹÓÃWindowsÑéÖ¤·½Ê½£¬Ê¹ÓÃÈçÏÂÃüÁîÐУ¬½«Ä¬ÈÏÊý¾Ý¿â¸Ä³É·Ç¶ªÊ§µÄÊý¾Ý¿â£º
isql /E /d"master" /Q"exec sp_defaultdb N'BUILTIN\Administrators', N'master'"
£¨2£©ÓÉÓڸıäÁËϵͳÃÜÂëµ¼ÖÂSQLSErverÎÞ·¨Æô¶¯
½â¾ö°ì·¨ÊÇ£º
µã»÷ÔËÐУ¬¼üÈëservices.msc£¬´ò¿ª·þÎñ³ÌÐò£¬ÕÒµ½SQLSERVERÏîÄ¿£¬Ñ¡ÔñÊôÐÔÏîÖ®¶þ-‘µÇ¼’£¬°ÑµÇ¼ÃÜÂë¸ÄΪ²Ù×÷ÏµÍ ......

Sql½¨¿â½¨±í

1.½¨¿â
declare @dbName varchar(20),@dataName varchar(2000),@dataPath varchar(2000),@logName varchar(2000),@logPath varchar(2000)
set @dbName='DB_Exam_OnLine_YHK'
set @dataName='DB_Exam_OnLIne_YHK_DB'
set @dataPath='D:\gaoFang\Exam\App_Data\DB_Exam_OnLIne_YHK_DB.mdf'
set @logName='DB_Exam_OnLIne_YHK_LG'
set @logPath='D:\gaoFang\Exam\App_Data\DB_Exam_OnLIne_YHK_LG.ldf'
exec('CREATE DATABASE '+@dbName+' on (name='+@dataName+', FILENAME='''+@dataPath+''') LOG ON (name='+@logName+', FILENAME='''+@logPath+''')')

2.ÅÅÐòʱҪעÒ⣺Èç1£¬11£¬9
µ±Îª×Ö·ûÐÍvarcharÅÅÐòʱΪ£º1£¬11£¬9
µ±ÎªÊýÖµÐÍint,decimal,floatµÈʱÅÅÐòΪ£º1£¬9£¬11
ËùÒÔ×Ö·ûÐ͵ÄÅÅÐò¿ÉÒÔÕâÑùдorder by Convert(decimal,×Ö·ûÐÍÊý¾Ý×Ö¶Î) »òÕßorder by Covert(Interge,×Ö·ûÐÍÊý¾Ý×Ö¶Î) ......

SQLÎÞÏÞ·ÖÀà´æ´¢¹ý³ÌÕûÀí2

Ä£·Â²Î¿¼:¶¯Ò×ÎÞÏÞ·ÖÀà
Óŵã:ËãµÃÉÏÊÇÕæÕýµÄÎÞÏÞ·ÖÀ࣬²»¹ýParentPathÊÇÓоÖÏÞÐÔ,ClassIDÊDZêʶÁÐ×Ô¶¯ÔöÒ».
ȱµã:ÐÂÔö¹ý³ÌÖÐParentID²»´æÔÚ»¹Ã»ÓÐÍêÉÆ£¬»á²åÈëNULLÊý¾Ý.ºóÃæÈý¸ö´æ´¢¹ý³Ì»¹ÔÚ²âÊÔ¡£
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ArticleClass]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[ArticleClass]
GO
CREATE TABLE [dbo].[ArticleClass] (
 [ClassID] [int] IDENTITY (1, 1) NOT NULL ,
 [ClassName] [nvarchar] (100) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
 [ParentID] [int] NULL ,
 [ParentPath] [nvarchar] (255) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL ,
 [Depth] [int] NULL ,
 [RootID] [int] NULL ,
 [Child] [int] NULL ,
 [PrevID] [int] NULL ,
 [NextID] [int] NULL ,
 [OrderID] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ArticleClass] ADD
 CONSTRAINT [DF_ArticleClass_ParentID_65E11278] DEFAULT (0) FOR [ParentID],
 CONSTRAINT [DF_ArticleClass_Depth_66D536B1] DEFAU ......

PL\SQL²éѯ³öÏÖÂÒÂë½â¾ö°ì·¨

1. ´ò¿ªpl\sql  ÔËÐÐÏÂÃæµÄ½Å±¾£¬²éѯ·þÎñÆ÷µÄ×Ö·û¼¯ ¡£
SELECT 'AMERICAN_AMERICA.' || PROPERTY_VALUE
from DATABASE_PROPERTIES
WHERE PROPERTY_NAME = 'NLS_CHARACTERSET';
ÎÒµÄÊÇ    AMERICAN_AMERICA.ZHS16GBK
2.ÔÚÔËÐÐÖÐÊäÈ룺regedit£¬´ò¿ª×¢²á±í±à¼­Æ÷£» 
3.HKEY_LOCAL_MACHINE->SOFTWARE->ORACLE->HOMEO
    Ë«»÷£ºNLS_LANG ½«£ºSIMPLIFIED CHINESE_CHINA.ZHS16GBK
 
¸ÃΪ¸Õ²Å²éѯ³öÀ´µÄ£º     AMERICAN_AMERICA.ZHS16GBK ......

ÓÅ»¯SQL ServerÊý¾Ý¿â·þÎñÆ÷ÄÚ´æÅäÖÃ

Ç°ÑÔ
Å©ÒµÒøÐÐ×ÜÐÐ1998ÄêÒÔÀ´ÕýʽÍƹãÁËаæÍøÂç°æ×ÛºÏÒµÎñͳ¼ÆÐÅϢϵͳ£¬¸ÃϵͳÊÇ»ùÓÚWindowsNT4.0ƽ̨£¬²ÉÓÿͻ§£¯·þÎñÆ÷ģʽ£¬ÒÔMicrosoft SQL ServerΪ»ù´¡½¨Á¢ÆðÀ´µÄ´óÐÍÊý¾Ý¿âÓ¦ÓóÌÐò£¬ÏµÍ³½çÃæÓѺᢲÙ×÷¼ò±ã£¬¼ÆËã¡¢·ÖÎö¡¢¼ìË÷¹¦Äܷdz£Ç¿´ó£¬Îª±£Ö¤Å©ÒµÒøÐÐϵͳ¼°Ê±½øÐÐ×ÝÏòºÍºáÏòÒµÎñÊý¾Ý²É¼¯¡¢°´ÕÕ²»Í¬ÒªÇóÉú³Éͳ¼Æ±¨±í£¬½øÐÐÈ«ÃæÒµÎñ»î¶¯·ÖÎöÌṩÁËÇ¿ÓÐÁ¦µÄ±£ÕÏ¡£µ«ÔÚÕâÌ׳ÌÐòµÄÍƹ㡢ά»¤ÖбÊÕß·¢ÏÖϵͳÓÐʱÔËÐÐËٶȽÏÂý£¬ÌرðÊÇÔÚ Win95¿Í»§¶Ë²Ù×÷ʱÓÈΪÑÏÖØ£¬¾­¹ýÅųýÍøÏßÁ¬½ÓµÈÓ²¼þ¿ÉÄÜ´øÀ´µÄÓ°ÏìºóÉÏÊöÎÊÌâÈÔÈ»´æÔÚ¡£±ÊÕß¾­¹ý×ÐϸÃþË÷£¬·¢ÏÖϵͳ¶ÔÓ²¡¢Èí¼þµÄÒªÇó½Ï¸ß£¬Îª³ä·Ö·¢»ÓÉè¼ÆЧÄÜ£¬´ïµ½×î¼ÑÔË×÷Ч¹û£¬ÐèÒª¶Ô¼ÆËã»úÓ²¡¢Èí¼þϵͳ½øÐнÏΪÍ걸µÄÐÔÄܲâÊÔÓë×î¼ÑÅäÖã¬ÌرðÊÇÄÚ´æÅäÖõĺûµ¶ÔϵͳµÄÔËÐÐËٶȾßÓоö¶¨ÐÔµÄ×÷Óá£ÏÂÃ棬±ÊÕß¾ÍÈçºÎÓÅ»¯SQLServerÊý¾Ý¿â·þÎñÆ÷µÄÄÚ´æÅäÖÃÌá³öһЩÈÏʶºÍ¿´·¨¡£
Ò»¡¢ÓйØÄÚ´æµÄ»ù±¾¸ÅÄî
1> ÎïÀíÄÚ´æÓëÐéÄâÄÚ´æ
WindowsNTʹÓÃÁ½ÀàÄڴ棺ÎïÀíÄÚ´æÓëÐéÄâÄÚ´æ¡£
ÎïÀíÄڴ棺×÷ΪRAMоƬ°²×°ÔÚ¼ÆËã»úÄÚ²¿µÄ´æ´¢Æ÷¡£
ÐéÄâÄڴ棺ÓÃÓÚÄ£ÄâRAMоƬ¹¦ÄܵĴÅÅÌ(Ó²ÅÌ)¿Õ¼ä£¬ÆäʵÖÊÊÇͨ¹ý½«ÄÚ´æÖе±Ç°Ã»ÓÐʹÓÃµÄ ......
×ܼǼÊý:4346; ×ÜÒ³Êý:725; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [716] [717] [718] [719] [720] [721] 722 [723] [724] [725]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ