SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Processor ID ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 11/06/2006 :  07:59:29  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Nihat writes "How can i get sql server processor_ID or HDD_ID with sql command?

thanks..."

chiragkhabaria
Flowing Fount of Yak Knowledge

India
1907 Posts

Posted - 11/06/2006 :  08:04:58  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message  Reply with Quote
you mean @@spid?

Select @@spid?

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 11/06/2006 :  09:47:42  Show Profile  Reply with Quote
quote:
Originally posted by chiragkhabaria

you mean @@spid?

Select @@spid?

Chirag

http://chirikworld.blogspot.com/



Wouldn't @@spid be Process ID, not Processor ID?




CODO ERGO SUM
Go to Top of Page

robvolk
Most Valuable Yak

USA
15676 Posts

Posted - 11/07/2006 :  16:06:44  Show Profile  Visit robvolk's Homepage  Reply with Quote
This works:

create table #a(a varchar(8000) null)
exec master..xp_cmdshell 'wmic cpu>c:\cpu.txt'
bulk insert #a from 'c:\cpu.txt'
declare @start int, @finish int
select @start=charindex('ProcessorId', a), @finish=charindex('ProcessorType',a) from #a where a like '%ProcessorType%'
select distinct substring(a, @start, @finish-@start) ProcessorID from #a where a not like '%ProcessorType%'
drop table #a


WMIC is a neat little command-line utility for WMI stuff. I'll leave it as an exercise for the reader to get the hard drive IDs.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000