• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆-167  評(píng)論-8  文章-0  trackbacks-0
                     1.在一臺(tái)sql server 上操作,我們要盡過(guò)能的知道數(shù)據(jù)的相關(guān)信息,這是性能分析的根本。

              查看能Sql Server 的相關(guān)信息,我們可以用Serverproperty來(lái)得到數(shù)據(jù)庫(kù)的相關(guān)信息,以下是ServerProperty 的相關(guān)使用說(shuō)明:

              SERVERPROPERTY

              Returns property information about the server instance.

              語(yǔ)法:

              Syntax

              SERVERPROPERTY ( propertyname )

              Arguments

              propertyname

              Is an expression containing the property information to be returned for the server. propertyname can be one of these values.

              數(shù)據(jù)庫(kù)屬性的相關(guān)參數(shù)

             

             

              Property name

             

             

              Values returned

             

             

              Collation

             

             

              The name of the default collation for the server.

              Returns NULL if invalid input or error.

              Base data type: nvarchar

             

             

              Edition

             

             

              The edition of the Microsoft® SQL Server™ instance installed on the server.

              Returns:

            'Desktop Engine'
            'Developer Edition'
            'Enterprise Edition'
            'Enterprise Evaluation Edition'
            'Personal Edition'
            'Standard Edition'

              Base data type: nvarchar(128)

             

             

              Engine Edition

             

             

              The engine edition of the SQL Server instance installed on the server.

              1 = Personal or Desktop Engine

              2 = Standard

              3 = Enterprise (returned for Enterprise, Enterprise Evaluation, and Developer)

              Base data type: int

             

             

              InstanceName

             

             

              The name of the instance to which the user is connected.

              Returns NULL if the instance name is the default instance, or invalid input or error.

              Base data type: nvarchar

             

             

              IsClustered

             

             

              The server instance is configured in a failover cluster.

              1 = Clustered.

              0 = Not Clustered.

              NULL = Invalid input, or error.

              Base data type: int

             

             

              IsFullTextInstalled

             

             

              The full-text component is installed with the current instance of SQL Server.

              1 = Full-text is installed.

              0 = Full-text is not installed.

              NULL = Invalid input, or error.

              Base data type: int

             

             

              IsIntegratedSecurityOnly

             

             

              The server is in integrated security mode.

              1 = Integrated Security.

              0 = Not Integrated Security.

              NULL = Invalid input, or error.

              Base data type: int

             

             

              IsSingleUser

             

             

              The server is in single user mode.

              1 = Single User.

              0 = Not Single User

              NULL = Invalid input, or error.

              Base data type: int

             

             

              IsSyncWithBackup

             

             

              The database is either a published database or a distribution database, and can be restored without disrupting transactional replication.

              1 = True.

              0 = False.

              Base data type: int

             

             

              LicenseType

             

             

              Mode of this instance of SQL Server.

              PER_SEAT = Per-seat mode

              PER_PROCESSOR = Per-processor mode

              DISABLED = Licensing is disabled.

              Base data type: nvarchar(128)

             

             

              MachineName

             

             

              Windows NT computer name on which the server instance is running.

              For a clustered instance, an instance of SQL Server running on a virtual server on Microsoft Cluster Server, it returns the name of the virtual server.

              Returns NULL if invalid input or error.

              Base data type: nvarchar

             

             

              NumLicenses

             

             

              Number of client licenses registered for this instance of SQL Server, if in per-seat mode.

              Number of processors licensed for this instance of SQL Server, if in per-processor mode.

              Returns NULL if the server is none of the above.

              Base data type: int

             

             

              ProcessID

             

             

              Process ID of the SQL Server service. (ProcessID is useful in identifying which sqlservr.exe belongs to this instance.)

              Returns NULL if invalid input or error.

              Base data type: int

             

             

              ProductVersion

             

             

              The version of the instance of SQL Server, in the form of 'major.minor.build'.

              Base data type: varchar(128)

             

             

              ProductLevel

             

             

              The level of the version of the SQL Server instance.

              Returns:

              'RTM' = shipping version.

              'SPn' = service pack version

              'Bn', = beta version.

              Base data type: nvarchar(128).

             

             

              ServerName

             

             

              Both the Windows NT server and instance information associated with a specified instance of SQL Server.

              Returns NULL if invalid input or error.

              Base data type: nvarchar

             

             

              例子:如要查詢(xún)電腦名,Sql server 數(shù)據(jù)庫(kù)實(shí)例名,數(shù)據(jù)庫(kù)版本,數(shù)據(jù)類(lèi)型,數(shù)據(jù)庫(kù)級(jí)別(如升包等)

            select
            SERVERPROPERTY('MachineName') as N’Machine Name’,
            serverproperty('Servername') as N’Server Name’,
            SERVERPROPERTY('ProductVersion') N'Database Version',
            SERVERPROPERTY ('Edition') N'Database Type',
            SERVERPROPERTY('ProductLevel') N'Database Packs'

              注意:@@Version 中的信息與 SERVERPROPERTY 中反映的信息是不一定相同的,查看Sql Server數(shù)據(jù)庫(kù)的信息我們應(yīng)該以SERVERPROPERTY 為準(zhǔn)。

            Select
            cast(SERVERPROPERTY('MachineName')as varchar(10))  as N'Machine Name',
            cast(SERVERPROPERTY('Servername') as varchar(20)) as N'Server Name',
            cast(SERVERPROPERTY('ProductVersion') as varchar(10)) N'Database Version',
            cast(SERVERPROPERTY ('Edition') as varchar(10)) N'Database Type',
            cast(SERVERPROPERTY('ProductLevel')as varchar(10)) N'Database Packs'

              Machine Name Server Name          Database Version Database Type Database Packs

              ------------ -------------------- ---------------- ------------- ----------

              VS-HKMESDB   VS-HKMESDBHKDB      8.00.760         Enterprise    SP3

              select @@version                                                                                                                                                                                                                                                                 

              ----------------------------------------------------------------------------------------------------------------------

            Microsoft SQL Server  2000 - 8.00.760 (Intel IA-64)
                   Feb  6 2003 16:07:24
                   Copyright (c) 1988-2003 Microsoft Corporation
                   Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

              上面兩個(gè)Sql 都返回了一些sql server 數(shù)據(jù)庫(kù)的信息,我們看到卻有兩個(gè)Service Pack,這里正確的Sql server server packe 是 SP3 ,  @@version 中的Service Pack 2 是sql server 所在電腦的windows 的 service pack ,這個(gè)不能弄混了。

            posted on 2009-12-30 10:42 老馬驛站 閱讀(240) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): DataBase
            久久久久久亚洲精品影院| 国产午夜精品理论片久久| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区 | 国产亚州精品女人久久久久久| 亚洲一区中文字幕久久| 久久精品综合一区二区三区| 色综合久久夜色精品国产| 国产午夜福利精品久久2021| 国产精品va久久久久久久| 99久久香蕉国产线看观香| 久久中文娱乐网| 伊人久久大香线蕉亚洲| 久久精品无码一区二区三区日韩 | 亚洲欧洲日产国码无码久久99| 久久久久免费精品国产| 亚洲国产精品无码久久| 激情综合色综合久久综合| 久久男人Av资源网站无码软件| 久久精品成人欧美大片| AV无码久久久久不卡网站下载 | 国产一区二区三精品久久久无广告 | 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 色综合久久久久综合体桃花网| 国产L精品国产亚洲区久久| av无码久久久久久不卡网站| 亚洲中文字幕久久精品无码APP| 精品久久久久久久久久久久久久久| 久久青青草原精品国产| 久久精品国产日本波多野结衣| 久久青青草原精品国产不卡| 精品免费tv久久久久久久| 国内精品九九久久久精品| 人妻无码αv中文字幕久久琪琪布| 一本久道久久综合狠狠躁AV| 午夜福利91久久福利| 性做久久久久久久久| 色婷婷狠狠久久综合五月| 久久综合精品国产一区二区三区 | 久久无码av三级| 久久国产精品免费一区| 久久国产精品偷99|