Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to know ??

Author  Topic 

rpc86
Posting Yak Master

200 Posts

Posted - 2006-12-07 : 22:31:13
Hi guys,

is there a way on how to return the serial number of the Hard Disk?
I know how to get the computer name or login name by usging "Select @Host_Name". But what I need to know is the serial number of the Hard Disk.

Thank you

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-12-07 : 22:41:33
Don't you have a screwdriver handy???

Go to Top of Page

rpc86
Posting Yak Master

200 Posts

Posted - 2006-12-07 : 22:44:24
hahaha, what I mean is I need to store the serial number of the computer in the SQL server table. I need this because we have more than 300 users.
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-12-07 : 23:55:07
You might want to have a look at the HDD drivers to see if they support such a thing. I would doubt that the serial number would be exposed via the driver, but no harm in trying....
Go to Top of Page

PSamsig
Constraint Violating Yak Guru

384 Posts

Posted - 2006-12-08 : 02:16:07
If it is only to identify the computer then why not the MAC address?

-- If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-12-08 : 02:17:06
via sql don't know but via an ide possible if supported
in vb, there's an object you can use to extract information about the host


HTH

--------------------
keeping it simple...
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2006-12-08 : 04:15:29
What frontend are you running ? web or desktop ?

There are other ways you can get the identity of the user.

Via web, you can use cookies, encrypted cookies, IP address and i have heard of MAC address, but dont know how to get the latter.

Afrika
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-11 : 05:43:12
[code]create table #temp (row varchar(80))

insert #temp
exec master..xp_cmdshell 'dir c:\'

declare @serial varchar(9)

select @serial = right(rtrim(row), 9)
from #temp where row like ' Volume Serial Number is %'

drop table #temp

select @serial[/code]

Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -