Wednesday, March 28, 2012

Information about an SQL server

i would like to create a Store procedure that can put the following
information into a database.
1.) Version of SQL on that instance
2.) Version of Windows including SPs (can i get this from SQL?)
3.) Size of each log file on the server instance
I would like to out this information to a database which i will connect to
via ASP so that it can be displayed on our Intranet .hi
can u check
select @.@.version
this will give u info that u require
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"Nick Pennisi" wrote:

> i would like to create a Store procedure that can put the following
> information into a database.
> 1.) Version of SQL on that instance
> 2.) Version of Windows including SPs (can i get this from SQL?)
> 3.) Size of each log file on the server instance
> I would like to out this information to a database which i will connect to
> via ASP so that it can be displayed on our Intranet .|||For the first two questions, use SELECT @.@.VERSION.
For the third question, use:
SELECT filename, size*8192 as filesize FROM master..sysaltfiles
Razvan|||1) You can parse SELECT @.@.VERSION
2) You can parse SELECT @.@.VERSION
3) see the following:
CREATE TABLE #logfiles
(
dbid int,
fileid int,
groupid int,
size bigint,
maxsize bigint,
growth bigint,
status bigint,
perf int,
name sysname,
filename sysname
)
EXEC sp_msForEachDB 'INSERT #logfiles SELECT DB_ID(N''?''),* FROM
[?]..sysfiles'
SELECT db_name(dbid),size,name,filename
FROM #logfiles
WHERE status & 0x40 = 0x40 -- log file
ORDER BY 1, name
DROP TABLE #logfiles
"Nick Pennisi" <NickPennisi@.discussions.microsoft.com> wrote in message
news:F041A69E-3057-458A-8FB0-DA1BAB8A2DFB@.microsoft.com...
>i would like to create a Store procedure that can put the following
> information into a database.
> 1.) Version of SQL on that instance
> 2.) Version of Windows including SPs (can i get this from SQL?)
> 3.) Size of each log file on the server instance
> I would like to out this information to a database which i will connect to
> via ASP so that it can be displayed on our Intranet .|||1 and 2 = SELECT @.@.VERSION
3 = sp_helpdb dbname
"Nick Pennisi" <NickPennisi@.discussions.microsoft.com> wrote in message
news:F041A69E-3057-458A-8FB0-DA1BAB8A2DFB@.microsoft.com...
>i would like to create a Store procedure that can put the following
> information into a database.
> 1.) Version of SQL on that instance
> 2.) Version of Windows including SPs (can i get this from SQL?)
> 3.) Size of each log file on the server instance
> I would like to out this information to a database which i will connect to
> via ASP so that it can be displayed on our Intranet .|||Try these 2 queries:
SELECT @.@.version
SELECT *
FROM master..sysaltfiles(nolock)
WHERE groupid = 0
"Nick Pennisi" <NickPennisi@.discussions.microsoft.com> wrote in message news:F041A69E-3057-
458A-8FB0-DA1BAB8A2DFB@.microsoft.com...
>i would like to create a Store procedure that can put the following
> information into a database.
>
> 1.) Version of SQL on that instance
> 2.) Version of Windows including SPs (can i get this from SQL?)
> 3.) Size of each log file on the server instance
>
> I would like to out this information to a database which i will connect to
> via ASP so that it can be displayed on our Intranet .|||1) select @.@.version
Hope this helps
Cheers,
JP
--
"Nick Pennisi" <NickPennisi@.discussions.microsoft.com> wrote in message
news:F041A69E-3057-458A-8FB0-DA1BAB8A2DFB@.microsoft.com...
>i would like to create a Store procedure that can put the following
> information into a database.
> 1.) Version of SQL on that instance
> 2.) Version of Windows including SPs (can i get this from SQL?)
> 3.) Size of each log file on the server instance
> I would like to out this information to a database which i will connect to
> via ASP so that it can be displayed on our Intranet .|||xp_msver
Returns and allows to be queried Microsoft SQL ServerT version information.
In addition to version information regarding the actual build number of the
server, various environment information is also returned. This information
can be used within Transact-SQL statements, batches, stored procedures, and
so on, to enhance logic for platform-independent code.
Syntax
xp_msver [optname]
Arguments
optname
Is the name of an option, and can be one of the following.
Option/Column name Description
ProductName Product name; for example, Microsoft SQL Server.
ProductVersion Product version; for example, 7.00.419 where 7.00 is
the version and 419 is the Microsoft internal build number.
Language The language version of SQL Server.
Platform Operating-system name, manufacturer name, and chip family
name for the computer running SQL Server. For example, NT INTEL X86
indicates Microsoft Windows NT as the operating system, Intel as the chip
manufacturer, and a 486 or higher processor.
Comments Miscellaneous information about SQL Server.
CompanyName Company name that produces SQL Server; for example,
Microsoft Corporation.
FileDescription The operating system.
FileVersion Version of the SQL Server executable. For example,
1998.02.01 indicates a file version of February 1, 1998, on the Sqlservr.exe
file.
InternalName Microsoft internal name for SQL Server; for example,
SQLSERVR.
LegalCopyright Legal copyright information required for SQL Server;
for example, Copyright Microsoft Corp. 1998.
LegalTrademarks Legal trademark information required for SQL Server.
For example, Microsoft is a registered trademark of Microsoft Corporation.
OriginalFilename File name executed at SQL Server startup; for
example, Sqlservr.exe.
PrivateBuild Reserved.
SpecialBuild Reserved.
WindowsVersion Microsoft Windows version installed on the computer
running SQL Server. For example, 4.0 indicates version 4.0 of Microsoft
Windows NT, and 1381 indicates the internal build number.
ProcessorCount The number of processors in the computer running SQL
Server.
ProcessorActiveMask Indicates what processors installed in the
computer running SQL Server are activated and usable by Microsoft Windows
NT.
ProcessorType Processor type. Similar to Platform.
PhysicalMemory Amount in megabytes (MB) of RAM installed on the
computer running SQL Server. For example, 32 indicates 32 MB of RAM.
Product ID Product ID (PID) number, which is specified during
installation. This number is located on a sticker on the original SQL Server
compact disc case.
Return Code Values
0 (success) or 1 (failure)
Result Sets
xp_msver, without any parameters, returns this four-column result set
(values may vary):
Index Name Internal_Value Character_Value
-- -- -- --
1 ProductName NULL Microsoft SQL
Server
2 ProductVersion 458752 7.00.498
3 Language 1033 English (United
States)
4 Platform NULL NT INTEL X86
5 Comments NULL NT INTEL X86
6 CompanyName NULL Microsoft
Corporation
7 FileDescription NULL SQL Server
Windows NT
8 FileVersion NULL 1998.05.25
9 InternalName NULL SQLSERVR
10 LegalCopyright NULL Copyright
Microsoft Corp. 1998
11 LegalTrademarks NULL Microsoft is a
registered trademark of
Microsoft Corporation. Windows(TM) is
a trademark of Microsoft
Corporation
12 OriginalFilename NULL SQLSERVR.EXE
13 PrivateBuild NULL NULL
14 SpecialBuild 262242 NULL
15 WindowsVersion 90505220 4.0 (1381)
16 ProcessorCount 1 1
17 ProcessorActiveMask 1 00000001
18 ProcessorType 586 PROCESSOR_INTEL_PENTIUM
19 PhysicalMemory 63 63 (66510848)
20 Product ID NULL NULL
(20 row(s) affected)
xp_msver, for any option, returns the four-column headings with values for
that option. For example, this result set is returned when xp_msver is
executed with the FileDescription option.
xp_msver FileDescription
Index Name Internal_Value Character_Value
-- -- -- --
7 FileDescription NULL SQL Server Windows NT
(1 row(s) affected)
Permissions
Execute permissions default to the public role.
See Also
System Functions
System Stored Procedures (General Extended Procedures)
@.@.VERSION
1988-2000 Microsoft Corporation. All Rights Reserved
"Nick Pennisi" <NickPennisi@.discussions.microsoft.com> wrote in message
news:F041A69E-3057-458A-8FB0-DA1BAB8A2DFB@.microsoft.com...
>i would like to create a Store procedure that can put the following
> information into a database.
> 1.) Version of SQL on that instance
> 2.) Version of Windows including SPs (can i get this from SQL?)
> 3.) Size of each log file on the server instance
> I would like to out this information to a database which i will connect to
> via ASP so that it can be displayed on our Intranet .

No comments:

Post a Comment