I had 500 hostnames in a trace file output and requirement was to get the IP addresses against each hostname so I had exported all the hostnames in a table in master Database and then created 'usp_getIPAdress_frm_Hostname' stored procedure in the same database and passed the table name as an input.
Please insert all the hostnames in a table (column name should be 'hostname') and then pass the table into the procedure. It will return the IP addresses for all hostnames without any changes in the source table.