1,  
select ip into @IPAddress from table1
2,
select max(ip) into @IPAddress from table1
不好意思,oracle中可用的,sqlserver中未经测试,自己试试吧
不过第二个思路一定是对的