1

In Windows we can get a unique string which represents the BIOS (unique to that machine)

Is there anything comparable in SQL Server where I can return the Identity or BIOS of that SQL Server installation (unique to that installation?)

John Saunders
  • 160,644
  • 26
  • 247
  • 397
aherrick
  • 19,799
  • 33
  • 112
  • 188
  • 1
    What would be your approach for doing it outside of windows? Something like [Get Hardware ID](http://stackoverflow.com/questions/2333149/how-to-fast-get-hardware-id-in-c) – billinkc Sep 02 '11 at 16:06
  • yeah basically just use C#. I just need a unique key that is unique to that installation of the DB. – aherrick Sep 02 '11 at 16:12
  • 1
    To that *installation*? What if there are multiple instances of SQL Server on that box, should they all return the same key? – billinkc Sep 02 '11 at 16:34
  • Well to that server installation. So if there are 2 instances of SQL Server 2008 (Server1, Server2) they should each return a unique key – aherrick Sep 02 '11 at 16:36

2 Answers2

0

I have built as extended stroed procedure as bridge to WMI you could just query

exec xp_wmiv3 'SELECT * FROM Win32_BIOS'

It can be downloaded at http://bummisoft.de/download/XP_WMI.zip. Versions contained for 32bit and 64bit Servers

bummi
  • 27,123
  • 14
  • 62
  • 101
0

A MAC address, maybe... although there could be more than one per machine.

CREATE TABLE #ipconfig(info varchar(256) null)
INSERT INTO #ipconfig EXEC master..xp_cmdshell 'ipconfig/all'
SELECT SubString(info, CharIndex(':', info) + 1, 99) AS MAC FROM #ipconfig
WHERE info Like '%Physical Address%'
DROP TABLE #ipconfig
jim31415
  • 8,588
  • 6
  • 43
  • 64
  • SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online. – aherrick Sep 02 '11 at 16:59
  • Is there any way I can get at something like that without first enabling xp_cmdshell? I may not always be admin... – aherrick Sep 02 '11 at 16:59