|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, April 18, 2013 6:58 AM
Points: 96,
Visits: 210
|
|
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.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, May 03, 2013 12:43 PM
Points: 2,
Visits: 9
|
|
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
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 6:11 AM
Points: 73,
Visits: 580
|
|
Nice article.
Regards,
Basit A. Farooq (MSC Computing, MCITP SQL Server 2005 & 2008, MCDBA SQL Server 2000)
http://basitaalishan.com
|
|
|
|