Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Map IP Address to a Geographical Location


Map IP Address to a Geographical Location

Author
Message
steven.malone
steven.malone
SSC-Enthusiastic
SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)SSC-Enthusiastic (112 reputation)

Group: General Forum Members
Points: 112 Visits: 227
Jeff Moden (4/18/2010)
I'm asking because I'd really like to quit.

And, you're correct. I quit twice for a year each and once for 3 months and not sure why I went back to it other than I like it and just wanted "one". The old saying holds true... "You're a puff away from a pack a day."


It took me about a dozen tries to quit. Here is what worked for me:
First and foremost, I cut out caffeine. Think about it, a nicotine fit looks just like being over-caffeinated.

Second, after the taper down phase, on my quit date, I intentionally changed my self image to a non-smoker. Post signs on the bathroom mirror, the refrigerator, in your car, in your cubicle, etc. As you go to sleep at night create a mental image of yourself as a non-smoker. Maybe on a tropical beach, maybe wearing white at a party with beautiful women all wearing white, whatever works for you.

Then when I felt a craving for a cigarette I would laugh at myself "don't be silly, you are a non-smoker." Nicotine is like the alien being in “Day of the Dove” http://en.wikipedia.org/wiki/Day_of_the_Dove feeding on your negative emotions. Laughing at it drives it away, stressing over it feeds it.

Good luck. As others have said you are a very special person and a major resource to many of us. It would be a shame to lose you before your time.

===============================
Anyway, back to the topic, I am trying to remember if anyone tested PARSENAME vs using a Tally Table. In this instance the tally table would only need to be 15 rows.
ron.hane
ron.hane
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 16
PARSENAME is a rEaLLy great tool here. Here's another way that isn't nearly as esthetically pleasing but is probably faster, just because it doesn't parse the string four times. In CLR form it would cook...

create function dbo.ConvertIp2NumC(@ipAddr nvarchar(15))
returns bigint
as
begin
declare @ipPos int, @ipLen int, @ipChar nchar(1), @segNum int, @ipNum bigint
set @segNum = 0
set @ipPos = 1
set @ipNum = 0
set @ipLen = len(isnull(@ipAddr, ''))
while @ipPos <= @ipLen begin
set @ipChar = substring(@ipAddr, @ipPos, 1)
if @ipChar = '.' begin
set @ipNum = (256 * @ipNum) + cast(@segNum as bigint)
set @segNum = 0
end else
set @segNum = (10 * @segNum) + cast(@ipChar as int)
set @ipPos = @ipPos + 1
end
set @ipNum = (256 * @ipNum) + cast(@segNum as bigint)
return @ipNum
end


Basit Farooq
Basit Farooq
SSC-Enthusiastic
SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)

Group: General Forum Members
Points: 143 Visits: 799
Nice article.

Regards,

Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)

http://basitaalishan.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search