Click here to Skip to main content
15,908,768 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi there,

I'm looking for a way to get the mac address of the current system by sql stored procedure.
I have found the following code by googling a lot, but i could not know what does this code do :

SQL
declare @t table
(
i uniqueidentifier default newsequentialid(),
m as cast(i as char(36))
)

insert into @t default values;

select
    substring(m,25,2) + '-' +
    substring(m,27,2) + '-' +
    substring(m,29,2) + '-' +
    substring(m,31,2) + '-' +
    substring(m,33,2) + '-' +
    substring(m,35,2) AS MacAddress
FROM @t


Is there any better way ?
Posted
Updated 13-Jul-14 19:24pm
v2
Comments
Mehdi Gholam 14-Jul-14 1:33am    
Why in the sproc?

1 solution

You can't get mac adrress of client computer via SQL stored procedure!

You need to write code in .net language (PhysicalAddress Class[^]) or batch/script (Get Remote MAC Address[^])
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900