最佳答案
滥用parsname函数:
create function INET_ATON (@addr varchar(15))
returns bigint
with schemabinding
as
begin
return
cast(parsename(@addr,4) as bigint) * 16777216 +
cast(parsename(@addr,3) as bigint) * 65536 +
cast(parsename(@addr,2) as bigint) * 256 +
cast(parsename(@addr,1) as bigint)
end
但是,这里不支持“简短地址”的事情.