<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Naru's &#187; Uncategorized</title>
	<atom:link href="http://n2canada.com/blog/archives/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://n2canada.com/blog</link>
	<description>Family, Technology, Life in general</description>
	<lastBuildDate>Sat, 02 Jan 2010 11:13:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Get blocking processes chain using CTE</title>
		<link>http://n2canada.com/blog/archives/get-blocking-processes-chain-using-cte</link>
		<comments>http://n2canada.com/blog/archives/get-blocking-processes-chain-using-cte#comments</comments>
		<pubDate>Fri, 10 Apr 2009 14:00:42 +0000</pubDate>
		<dc:creator>Navket</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://n2canada.com/blog/?p=189</guid>
		<description><![CDATA[SQL Server 2005 introduced common type expressions. I find it really useful in writing recursive queries. Getting a blocking chain of spids is one way I use CTEs to check for the lead blocker.

&#160;
WITH Blocking_chain&#40; ROW, DEPTH, dbname, spid, hostname, program, 
		waittime, blocked, sql_handle, stmt_start, stmt_end &#41; AS 
	&#40; 
		SELECT 
			row_number&#40;&#41; OVER&#40;ORDER BY a.spid&#41; &#91;ROW&#93;,
			0 [...]]]></description>
			<content:encoded><![CDATA[<p>SQL Server 2005 introduced common type expressions. I find it really useful in writing recursive queries. Getting a blocking chain of spids is one way I use CTEs to check for the lead blocker.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;">&nbsp;
<span style="color: #0000FF;">WITH</span> Blocking_chain<span style="color: #808080;">&#40;</span> <span style="color: #0000FF;">ROW</span>, <span style="color: #0000FF;">DEPTH</span>, dbname, spid, hostname, program, 
		waittime, blocked, sql_handle, stmt_start, stmt_end <span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> 
	<span style="color: #808080;">&#40;</span> 
		<span style="color: #0000FF;">SELECT</span> 
			row_number<span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">OVER</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">ORDER</span> <span style="color: #0000FF;">BY</span> a.<span style="color: #202020;">spid</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&#91;</span><span style="color: #0000FF;">ROW</span><span style="color: #808080;">&#93;</span>,
			<span style="color: #000;">0</span> <span style="color: #808080;">&#91;</span><span style="color: #0000FF;">DEPTH</span><span style="color: #808080;">&#93;</span> ,
			<span style="color: #FF00FF;">DB_NAME</span><span style="color: #808080;">&#40;</span>a.<span style="color: #202020;">dbid</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&#91;</span>dbname<span style="color: #808080;">&#93;</span>, 
			a.<span style="color: #202020;">spid</span>, 
			a.<span style="color: #202020;">hostname</span>, 
			a.<span style="color: #202020;">program_name</span>, 
			a.<span style="color: #202020;">waittime</span>,
			a.<span style="color: #202020;">blocked</span>,
			a.<span style="color: #202020;">sql_handle</span>,
			a.<span style="color: #202020;">stmt_start</span>,
			a.<span style="color: #202020;">stmt_end</span>
		<span style="color: #0000FF;">FROM</span> 
			master.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysprocesses</span> a 
			<span style="color: #0000FF;">INNER</span> join master.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysprocesses</span> b <span style="color: #0000FF;">ON</span> b.<span style="color: #202020;">blocked</span> <span style="color: #808080;">=</span> a.<span style="color: #202020;">spid</span>
		<span style="color: #0000FF;">WHERE</span> 
			a.<span style="color: #202020;">blocked</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span> and a.<span style="color: #202020;">ecid</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span>
		<span style="color: #0000FF;">UNION</span> all
		<span style="color: #0000FF;">SELECT</span> 
			b.<span style="color: #0000FF;">ROW</span>, 
			b.<span style="color: #0000FF;">DEPTH</span> <span style="color: #808080;">+</span> <span style="color: #000;">1</span> , 
			<span style="color: #FF00FF;">DB_NAME</span><span style="color: #808080;">&#40;</span>a.<span style="color: #202020;">dbid</span><span style="color: #808080;">&#41;</span>, 
			a.<span style="color: #202020;">spid</span>, 
			a.<span style="color: #202020;">hostname</span>, 
			a.<span style="color: #202020;">program_name</span>, 
			a.<span style="color: #202020;">waittime</span>,
			a.<span style="color: #202020;">blocked</span>,
			a.<span style="color: #202020;">sql_handle</span>,
			a.<span style="color: #202020;">stmt_start</span>,
			a.<span style="color: #202020;">stmt_end</span>
		<span style="color: #0000FF;">FROM</span> 
			master.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">sysProcesses</span> a 
			<span style="color: #0000FF;">INNER</span> join Blocking_chain b <span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">blocked</span> <span style="color: #808080;">=</span> b.<span style="color: #202020;">spid</span>
		<span style="color: #0000FF;">WHERE</span> 
			a.<span style="color: #202020;">blocked</span> <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span> and a.<span style="color: #202020;">ecid</span> <span style="color: #808080;">=</span> <span style="color: #000;">0</span> 
	<span style="color: #808080;">&#41;</span>
&nbsp;
<span style="color: #0000FF;">SELECT</span> p.<span style="color: #808080;">*</span>, 
<span style="color: #0000FF;">CASE</span> 
	<span style="color: #0000FF;">WHEN</span> p.<span style="color: #202020;">stmt_start</span><span style="color: #808080;">=</span><span style="color: #000;">0</span> <span style="color: #0000FF;">THEN</span> t.<span style="color: #0000FF;">TEXT</span> 
	<span style="color: #0000FF;">WHEN</span> p.<span style="color: #202020;">stmt_end</span> <span style="color: #808080;">&lt;</span> <span style="color: #000;">0</span> <span style="color: #0000FF;">THEN</span> <span style="color: #FF00FF;">SUBSTRING</span><span style="color: #808080;">&#40;</span>t.<span style="color: #0000FF;">TEXT</span>, p.<span style="color: #202020;">stmt_start</span><span style="color: #808080;">/</span><span style="color: #000;">2</span>, <span style="color: #FF00FF;">LEN</span><span style="color: #808080;">&#40;</span>t.<span style="color: #0000FF;">TEXT</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">/</span><span style="color: #000;">2</span> <span style="color: #808080;">&#41;</span> 
	<span style="color: #0000FF;">ELSE</span> <span style="color: #FF00FF;">SUBSTRING</span><span style="color: #808080;">&#40;</span>t.<span style="color: #0000FF;">TEXT</span>, p.<span style="color: #202020;">stmt_start</span><span style="color: #808080;">/</span><span style="color: #000;">2</span>, <span style="color: #808080;">&#40;</span>p.<span style="color: #202020;">stmt_end</span><span style="color: #808080;">-</span>p.<span style="color: #202020;">stmt_start</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">/</span><span style="color: #000;">2</span> <span style="color: #808080;">&#41;</span> 
<span style="color: #0000FF;">END</span> <span style="color: #808080;">&#91;</span><span style="color: #0000FF;">STATEMENT</span><span style="color: #808080;">&#93;</span> 
<span style="color: #0000FF;">FROM</span> 
	Blocking_chain p 
	cross apply sys.<span style="color: #202020;">dm_exec_sql_text</span><span style="color: #808080;">&#40;</span>p.<span style="color: #202020;">sql_handle</span><span style="color: #808080;">&#41;</span> t</pre></div></div>

</pre>
]]></content:encoded>
			<wfw:commentRss>http://n2canada.com/blog/archives/get-blocking-processes-chain-using-cte/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I hate the &#8220;System Access Fee&#8221;</title>
		<link>http://n2canada.com/blog/archives/i-hate-the-system-access-fee</link>
		<comments>http://n2canada.com/blog/archives/i-hate-the-system-access-fee#comments</comments>
		<pubDate>Fri, 04 Jan 2008 03:22:14 +0000</pubDate>
		<dc:creator>Navket</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bell]]></category>
		<category><![CDATA[Cell phone]]></category>
		<category><![CDATA[rogers]]></category>
		<category><![CDATA[telus]]></category>

		<guid isPermaLink="false">http://n2canada.com/blog/archives/i-hate-the-system-access-fee</guid>
		<description><![CDATA[All Canadian cell phone service providers are charging their customers a so called &#8220;system access fee&#8221; as a separate bill item to make it look as if its some genuine fee and is not for their profit. However this is a guise they use so that they can advertise lower rates. You see a plan [...]]]></description>
			<content:encoded><![CDATA[<p>All Canadian cell phone service providers are charging their customers a so called &#8220;system access fee&#8221; as a separate bill item to make it look as if its some genuine fee and is not for their profit. However this is a guise they use so that they can advertise lower rates. You see a plan for $25 , the moment you enter into a contract, you end up paying more than $45 when all the fees and services add up. Lets see how the major providers are justifying the system access fee..</p>
<p>&#8212;- <strong>Telus</strong> &#8212;-<br />
The System Access Fee covers a number of costs, including: spectrum acquisition and licensing charges, contribution charges to help subsidize residential telephone service in rural and remote areas, costs associated with area code changes, invoicing requirements for special needs clients, relay services (TDD) and related costs. The remainder, if any, goes towards the costs of operating TELUS Mobilityâ€™s national wireless networks, including new equipment and installations, ongoing maintenance and technology upgrades.<br />
&#8212;- <strong>Rogers</strong> &#8212;-<br />
The System Access Fee is charged by all wireless carriers to help cover the costs associated with the ongoing expansion and upgrading of the wireless network. The fee is not required by nor collected for the federal government or any of its agencies. It is billed in advance each month, and will appear twice on your first invoice. One is for the month in advance and the second is a prorated fee from your activation date to the end of your first bill period.</p>
<p>&#8212;- <strong>Bell</strong> &#8212;-<br />
The system access fee helps recover costs for ongoing maintenance, new equipment installations and technology upgrades. This service fee ensures that we are able to continuously provide customers with improved network quality and extensive coverage, as well as leading-edge next generation products and services.</p>
<p>&#8212;-</p>
<p>The bottomline is that the system access fee is just to mislead the consumer and if the fee is to access anything, it&#8217;s your wallet.</p>
]]></content:encoded>
			<wfw:commentRss>http://n2canada.com/blog/archives/i-hate-the-system-access-fee/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
