<?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>My Technology &#187; SQL Server</title>
	<atom:link href="http://www.robertpalmertech.com/category/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertpalmertech.com</link>
	<description>Mortgage CRM, Telemarketing, Trixbox, Asterisk, FreePBX, Datatrac, Calyx, HECM Calculator</description>
	<lastBuildDate>Sun, 19 Apr 2009 22:15:40 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.41</generator>
	<item>
		<title>Do Not Call Scrubbing</title>
		<link>http://www.robertpalmertech.com/sql-server/8-do-not-call-scrubbing/</link>
		<comments>http://www.robertpalmertech.com/sql-server/8-do-not-call-scrubbing/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 22:15:40 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.robertpalmertech.com/?p=8</guid>
		<description><![CDATA[We entered the world of telemarketing recently which opened up some interested issues with Do Not Call management in our databases.Â  I took a look at some outsourced solutions but in the end I decided to throw together a very basic SQL Script to handle this scrubbing.Â  Its a pretty basic script but it did [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We entered the world of telemarketing recently which opened up some interested issues with Do Not Call management in our databases.Â  I took a look at some outsourced solutions but in the end I decided to throw together a very basic SQL Script to handle this scrubbing.Â  Its a pretty basic script but it did the trick.</p>
<p>Additionally, I placed a last scrub date in our CRM that will prevent any telemarketing activities if we exceed the 30 day mark, as well as an ability to add internal numbers to the Do Not Call Database, and a function to run the DNC script whenever new leads or contacts are updated.</p>
<p>One of my issues is my phone numbers are stored as 10 digits and the DNC database I created has a column for area code and another column for phone.Â  I used the Right and Left functions to pull out the two parts.Â  Once a Do Not Call Number is identified it is replaced with &#8216;SCRUBED DNC&#8217;.Â  I chose to write over the numbers, you may wish to keep them and flag the record in another way.</p>
<p>CODE:</p>
<p><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">UPDATE</span></span></span><span style="font-size: x-small; color: #0000ff;">Â </span></span>Â <span style="font-size: x-small;">leadsDB</span></p>
<p><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">SET</span></span></span><span style="font-size: x-small; color: #0000ff;">Â </span></span><span style="font-size: x-small;">PHONE </span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">=</span></span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;"><span style="font-size: x-small; color: #ff0000;">&#8216;SCRUBBED DNC&#8217;</span></span><span style="font-size: x-small;"> </span></p>
<p><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">where</span></span></span></span>Â <span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">right(</span></span><span style="font-size: x-small;">phone</span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">,</span></span><span style="font-size: x-small;">7</span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">)</span></span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">IN</span></span><span style="font-size: x-small;"> </span></p>
<p><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">(</span></span></span><span style="font-size: x-small; color: #808080;">Â </span></span>Â <span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">select</span></span><span style="font-size: x-small;"> number </span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">from</span></span></span><span style="font-size: x-small; color: #0000ff;">Â </span></span><span style="font-size: x-small;">DNCNew </span></p>
<p><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">where</span></span></span><span style="font-size: x-small; color: #0000ff;">Â </span></span>Â <span style="font-size: x-small;">AreaCode </span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">=</span></span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">left(</span></span><span style="font-size: x-small;">phone</span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">,</span></span><span style="font-size: x-small;">3</span><span style="font-size: x-small; color: #808080;"><span style="font-size: x-small; color: #808080;">)</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertpalmertech.com/sql-server/8-do-not-call-scrubbing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
