Friday, February 24, 2012

Obtain msinfo32 info + am I SAN attached ?

I like the first screen shot of the msinfo32.exe that talks about OS
version, physical memory,Model,etc. I dont need all the info that it
provides such as hardware resources,components...
I just need that first opening page contents
Also, how can I find out if my server is SAN attached or has direct attached
storage programatically ?
I would prefer any TSQL way of obtaining the info
Thanks
Hi Hassan
"Hassan" wrote:

> I like the first screen shot of the msinfo32.exe that talks about OS
> version, physical memory,Model,etc. I dont need all the info that it
> provides such as hardware resources,components...
> I just need that first opening page contents
> Also, how can I find out if my server is SAN attached or has direct attached
> storage programatically ?
> I would prefer any TSQL way of obtaining the info
> Thanks
>
I have pointed you to the solution for this in your previous posts. It
doesn't really matter if you return more information than needed from
MSINFO32 as you can just ignore then when loading/loaded
For example:
USE TEMPDB
GO
EXEC xp_cmdshell '"C:\Program Files\Common Files\Microsoft
Shared\MSInfo\msinfo32.exe" /categories +ComponentsStorageDisks /report
C:\temp\system.txt'
GO
-- This will create a single record with the systeminfo as content which you
can
-- pattern match on
SELECT *
FROM OPENROWSET(BULK N'C:\temp\system.txt', SINGLE_NCLOB) AS Sysinfo
GO
-- Alternatively it may be easier to return each line as a separate row
CREATE TABLE dbo.systeminfo ( sysinfo varchar(max))
GO
BULK INSERT tempdb..systeminfo
FROM 'C:\temp\system.txt'
WITH
(
DATAFILETYPE = 'widechar',
ROWTERMINATOR = '\n'
)
GO
SELECT * FROM dbo.systeminfo
DROP TABLE dbo.systeminfo
John
|||Hassan (hassan@.hotmail.com) writes:
> I like the first screen shot of the msinfo32.exe that talks about OS
> version, physical memory,Model,etc. I dont need all the info that it
> provides such as hardware resources,components...
> I just need that first opening page contents
The extended stored procedure xp_msver has some of that information.

> Also, how can I find out if my server is SAN attached or has direct
> attached storage programatically ?
Beats me. :-(
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
|||Cool. Thanks John.
Do you know how I could put those values in 2 columns for item and value ?
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:BF35DE06-0415-41A8-A5C2-83A03CD09374@.microsoft.com...
> Hi Hassan
> "Hassan" wrote:
> I have pointed you to the solution for this in your previous posts. It
> doesn't really matter if you return more information than needed from
> MSINFO32 as you can just ignore then when loading/loaded
> For example:
> USE TEMPDB
> GO
> EXEC xp_cmdshell '"C:\Program Files\Common Files\Microsoft
> Shared\MSInfo\msinfo32.exe" /categories +ComponentsStorageDisks /report
> C:\temp\system.txt'
> GO
> -- This will create a single record with the systeminfo as content which
> you
> can
> -- pattern match on
> SELECT *
> FROM OPENROWSET(BULK N'C:\temp\system.txt', SINGLE_NCLOB) AS Sysinfo
> GO
> -- Alternatively it may be easier to return each line as a separate row
> CREATE TABLE dbo.systeminfo ( sysinfo varchar(max))
> GO
> BULK INSERT tempdb..systeminfo
> FROM 'C:\temp\system.txt'
> WITH
> (
> DATAFILETYPE = 'widechar',
> ROWTERMINATOR = '\n'
> )
> GO
> SELECT * FROM dbo.systeminfo
> DROP TABLE dbo.systeminfo
> John

No comments:

Post a Comment