Need server name using ip address

thayduck
thayduck used Ask the Experts™
on
I have a sql 2008 table that has a ip address field and a empty server name field.

How can I update the server name field using the ip address field within a sql stored procerdure ?

It looks like you have to use nslookup, but I am not sure how.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Use xp_cmdshell

http://msdn.microsoft.com/en-us/library/ms175046.aspx

ie: exec master..xp_cmdshell 'nslookup experts-exchange.com'
thayduckProgrammer Analyst

Author

Commented:
Looks like I am not allowed to use xp_cmdshell. I will send a email to our security people to find out why.

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.
 
It is disabled by default ad it opens up alot of possible trouble
thayduckProgrammer Analyst

Author

Commented:
Since our server security team will not allow us access to this command I cannot try. I will award you the points since it looks like it might have worked.
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial