Some options
Use an SQL function
I don't know if there exists one in MSSQL, I know MySQL has one called
inet_ntoa() that converts decimal to IP
Create your own SQL function
I have some PostgreSQL functions I made, if you want them just let me know.
Use Perl or some other script language to do the conversion
I use the following with Perl:
# Convert decimal to IP
my $dec = 13018098;
my $ip = join(".", unpack("C4", pack("N", $dec)));
# Convert IP to decimal
my $ip = 1.1.1.1;
my $dec = unpack("N", pack("C4", split(/\./,$ip)));
-------------------------------------
Hi lists ;-)
I have a question at Tivoli NetView for NT
On MSSQL database's table,
In ipAddress field,there are filled with integer something like 32372939
I'd like convert 32372939 to xxx.xxx.xxx.xxx
How can I convert interger to IP address? There's a rule to resolving that?
Thanks In Advance..
Christian Frantsen
CSC, Computer Sciences Corporation
Jonkoping, Sweden
"I don't need to test my programs. I have an error-correcting modem."
|