<?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>{ mefyi.com }</title>
	<atom:link href="http://www.qihost.com/myWiki/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.qihost.com/myWiki</link>
	<description></description>
	<lastBuildDate>Mon, 20 Feb 2012 21:58:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SQL bcp import skip first row example</title>
		<link>http://www.qihost.com/myWiki/2012/02/sql-bcp-import-skip-first-row-example/</link>
		<comments>http://www.qihost.com/myWiki/2012/02/sql-bcp-import-skip-first-row-example/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 21:58:58 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[MsSQL]]></category>
		<category><![CDATA[bcp]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1368</guid>
		<description><![CDATA[&#8220;G:\Program Files\90\Tools\Binn\bcp&#8221; salesreps.dbo.zRaw_SalesGrp in &#8220;G:\Integration\Pervasive\SalesRep\batch\SalesGrp.csv&#8221; -F2 -c -t, -SDTSQLV2\INSTANCE2 -Uxxxxx -Pxxxxx]]></description>
			<content:encoded><![CDATA[<p>&#8220;G:\Program Files\90\Tools\Binn\bcp&#8221; salesreps.dbo.zRaw_SalesGrp in &#8220;G:\Integration\Pervasive\SalesRep\batch\SalesGrp.csv&#8221; <strong>-F2</strong> -c -t, -SDTSQLV2\INSTANCE2 -Uxxxxx -Pxxxxx</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2012/02/sql-bcp-import-skip-first-row-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SDFC: Get It Right the First Time User Administration</title>
		<link>http://www.qihost.com/myWiki/2012/01/sdfc-get-it-right-the-first-time-user-administration/</link>
		<comments>http://www.qihost.com/myWiki/2012/01/sdfc-get-it-right-the-first-time-user-administration/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 22:24:50 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[SFDC]]></category>
		<category><![CDATA[SFDC Administration]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1363</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/uc13wsQJzz0" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed wmode="opaque" src="http://www.youtube.com/v/uc13wsQJzz0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2012/01/sdfc-get-it-right-the-first-time-user-administration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SFDC: Administration 101</title>
		<link>http://www.qihost.com/myWiki/2012/01/sfdc-administration-101/</link>
		<comments>http://www.qihost.com/myWiki/2012/01/sfdc-administration-101/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 20:36:43 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[SFDC]]></category>
		<category><![CDATA[SFDC Administration]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1361</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/BlMBkroNx_8" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed wmode="opaque" src="http://www.youtube.com/v/BlMBkroNx_8" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2012/01/sfdc-administration-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SFDC nice examples</title>
		<link>http://www.qihost.com/myWiki/2012/01/sfdc-nice-examples/</link>
		<comments>http://www.qihost.com/myWiki/2012/01/sfdc-nice-examples/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 19:12:22 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[SFDC]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1359</guid>
		<description><![CDATA[http://shivasoft.in/blog/category/salesforce/ http://forcemonkey.blogspot.com/2011/07/how-to-prepare-for-salesforcecom.html]]></description>
			<content:encoded><![CDATA[<p>http://shivasoft.in/blog/category/salesforce/</p>
<p>http://forcemonkey.blogspot.com/2011/07/how-to-prepare-for-salesforcecom.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2012/01/sfdc-nice-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resume: ETL</title>
		<link>http://www.qihost.com/myWiki/2012/01/resume-etl/</link>
		<comments>http://www.qihost.com/myWiki/2012/01/resume-etl/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 21:01:47 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[etl]]></category>
		<category><![CDATA[resume]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1356</guid>
		<description><![CDATA[http://davidhubbard.net/resume_informatica_etl_architect/]]></description>
			<content:encoded><![CDATA[<p>http://davidhubbard.net/resume_informatica_etl_architect/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2012/01/resume-etl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL update join</title>
		<link>http://www.qihost.com/myWiki/2011/12/sql-update-join/</link>
		<comments>http://www.qihost.com/myWiki/2011/12/sql-update-join/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 20:53:58 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[MsSQL]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Sybase]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[update join]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1354</guid>
		<description><![CDATA[UPDATE B SET B.[LAST_RECRUIT_PRINT_DATE] = A.[LAST_RECRUIT_PRINT_DATE], B.[LAST_RECRUIT_ONLINE_DATE] = A.[LAST_RECRUIT_ONLINE_DATE] FROM [Web_HearstSalesForce].[dbo].[VW_AccountsRecruit_320] A, [Web_HearstSalesForce].[dbo].[Accounts] B WHERE A.AccountNumber=B.AccountNumber]]></description>
			<content:encoded><![CDATA[<p>	UPDATE B<br />
	SET<br />
		B.[LAST_RECRUIT_PRINT_DATE] = A.[LAST_RECRUIT_PRINT_DATE],<br />
		B.[LAST_RECRUIT_ONLINE_DATE] = A.[LAST_RECRUIT_ONLINE_DATE]<br />
	FROM<br />
		[Web_HearstSalesForce].[dbo].[VW_AccountsRecruit_320] A,<br />
		[Web_HearstSalesForce].[dbo].[Accounts] B<br />
	WHERE A.AccountNumber=B.AccountNumber	</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2011/12/sql-update-join/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AdmarcMactive_2_2K11_12_28</title>
		<link>http://www.qihost.com/myWiki/2011/12/admarcmactive_2_2k11_12_28/</link>
		<comments>http://www.qihost.com/myWiki/2011/12/admarcmactive_2_2k11_12_28/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 20:52:22 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[MsSQL]]></category>
		<category><![CDATA[chron]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[SFDC]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1352</guid>
		<description><![CDATA[USE [Web_HearstSalesForce] GO /****** Object: StoredProcedure [dbo].[AdmarcMactive_2] Script Date: 12/28/2011 14:48:14 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO &#8211; ============================================= &#8211; Author: Ernest W. Lessenger &#8211; Create date: 3/25/2010 &#8211; Description: Prepares the Admarc/Mactive import tables for import &#8211; ============================================= ALTER PROCEDURE [dbo].[AdmarcMactive_2] AS BEGIN &#8211; SET NOCOUNT ON added to prevent extra [...]]]></description>
			<content:encoded><![CDATA[<p>USE [Web_HearstSalesForce]<br />
GO<br />
/****** Object:  StoredProcedure [dbo].[AdmarcMactive_2]    Script Date: 12/28/2011 14:48:14 ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
&#8211; =============================================<br />
&#8211; Author:		Ernest W. Lessenger<br />
&#8211; Create date: 3/25/2010<br />
&#8211; Description:	Prepares the Admarc/Mactive import tables for import<br />
&#8211; =============================================<br />
ALTER PROCEDURE [dbo].[AdmarcMactive_2]<br />
AS<br />
BEGIN<br />
	&#8211; SET NOCOUNT ON added to prevent extra result sets from<br />
	&#8211; interfering with SELECT statements.<br />
	SET NOCOUNT ON;</p>
<p>	EXEC [Clear_Deleted];</p>
<p>    &#8212; Set the unique identifiers used for performing upserts<br />
    &#8212; This is being done statically rather than using a view in order to permit indexing of the unique<br />
    &#8212; ID columns if required<br />
	UPDATE Accounts<br />
		SET [Account_Id__c] = LTRIM(RTRIM([Business_Unit__c])) + &#8216;.&#8217; + LTRIM(RTRIM([AccountNumber]));</p>
<p>	UPDATE Accounts<br />
		SET [ParentAccountId] = LTRIM(RTRIM([Business_Unit__c])) + &#8216;.&#8217; + LTRIM(RTRIM([ParentAccountNumber]))<br />
		WHERE ([ParentAccountNumber] IS NOT NULL);</p>
<p>	UPDATE Orders<br />
		SET [Account_Id__c] = LTRIM(RTRIM([Business_Unit__c])) + &#8216;.&#8217; + LTRIM(RTRIM([AccountNumber])),<br />
			[OrderID__c] = LTRIM(RTRIM([Business_Unit__c])) + &#8216;.&#8217; + LTRIM(RTRIM([OrderNumber]));</p>
<p>	UPDATE Appearances<br />
		SET [OrderId__c] = LTRIM(RTRIM([Business_Unit__c])) + &#8216;.&#8217; + LTRIM(RTRIM([OrderNumber])),<br />
			[ScheduleID__c] = LTRIM(RTRIM([Business_Unit__c])) + &#8216;.&#8217; + LTRIM(RTRIM([OrderNumber])) + &#8216;.&#8217; + LTRIM(RTRIM(convert(nvarchar(40),[Sequence__c])));</p>
<p>	UPDATE Accounts<br />
		SET RecordTypeId = &#8217;012A00000009A6tIAE&#8217;<br />
		WHERE (RecordTypeId IS NULL);</p>
<p>	UPDATE Appearances<br />
		SET Amount = 0.0<br />
		WHERE (Amount IS NULL);</p>
<p>	UPDATE Orders<br />
		SET Amount = 0.0<br />
		WHERE (Amount IS NULL);</p>
<p>	&#8211; Create indexes</p>
<p>	IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Accounts]&#8216;) AND name = N&#8217;IDX_Accounts_AccountId&#8217;)<br />
	CREATE NONCLUSTERED INDEX [IDX_Accounts_AccountId] ON [dbo].[Accounts]<br />
	( [Account_Id__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY];</p>
<p>	IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Accounts]&#8216;) AND name = N&#8217;IDX_Accounts_DUNS&#8217;)<br />
	CREATE NONCLUSTERED INDEX [IDX_Accounts_DUNS] ON [dbo].[Accounts]<br />
	( [DUNS_Number__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY];</p>
<p>	IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Appearances]&#8216;) AND name = N&#8217;IDX_Appearances_ScheduleId&#8217;)<br />
	CREATE NONCLUSTERED INDEX [IDX_Appearances_ScheduleId] ON [dbo].[Appearances]<br />
	( [ScheduleID__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]</p>
<p>	IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Appearances]&#8216;) AND name = N&#8217;IDX_Appearances_OrderId&#8217;)<br />
	CREATE CLUSTERED INDEX [IDX_Appearances_OrderId] ON [dbo].[Appearances]<br />
	( [OrderId__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]</p>
<p>	IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Orders]&#8216;) AND name = N&#8217;IDX_Orders_OrderId&#8217;)<br />
	CREATE NONCLUSTERED INDEX [IDX_Orders_OrderId] ON [dbo].[Orders]<br />
	( [OrderID__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]</p>
<p>	IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Orders]&#8216;) AND name = N&#8217;IDX_Orders_AccountId&#8217;)<br />
	CREATE NONCLUSTERED INDEX [IDX_Orders_AccountId] ON [dbo].[Orders]<br />
	( [Account_Id__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]</p>
<p>	IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Appearances]&#8216;) AND name = N&#8217;IDX_Appearances_OrderId&#8217;)<br />
	CREATE NONCLUSTERED INDEX [IDX_Appearances_RepNbr] ON [dbo].[Appearances]<br />
	( [REP NBR] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]</p>
<p>	&#8211; Set the SFDC Id for the appearances that already exist in Salesforce<br />
	&#8211;UPDATE [Appearances]<br />
	&#8211;	SET [Id] = o.[Id]<br />
	&#8211;FROM [Appearances] AS a INNER JOIN [OpportunityLineItem] AS o<br />
	&#8211;	ON (a.[ScheduleID__c] = o.[ScheduleId__c])<br />
	&#8211;WHERE (o.IsDeleted = 0);</p>
<p>	&#8211; Set the SFDC Id for Parent Accounts</p>
<p>	&#8211; Set the ParentId on Accounts for all accounts that have parents in the 999 business unit<br />
	UPDATE Accounts<br />
		SET ParentId = ca.ParentId<br />
	FROM Accounts a INNER JOIN Account ca ON (a.Account_Id__c = ca.Account_Id__c)<br />
		INNER JOIN Account pa ON (ca.ParentId = pa.Id)<br />
	WHERE (ca.IsDeleted = 0) AND (pa.IsDeleted = 0)<br />
		AND (pa.Business_Unit__c = &#8217;999&#8242;)<br />
		AND (a.ParentId IS NULL);</p>
<p>	UPDATE Accounts<br />
		SET ParentId = pa.Id<br />
	FROM Accounts a INNER JOIN Account pa ON (a.ParentAccountId = pa.Account_Id__c)<br />
	WHERE (a.ParentAccountNumber IS NOT NULL)<br />
		AND (pa.IsDeleted = 0)<br />
		AND (a.ParentId IS NULL);</p>
<p>	&#8211; Drop the exception tables so they can be recreated later</p>
<p>	IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Accounts_Exception1]&#8216;) AND type in (N&#8217;U'))<br />
		DROP TABLE [dbo].[Accounts_Exception1];<br />
	IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Orders_Exception1]&#8216;) AND type in (N&#8217;U'))<br />
		DROP TABLE [dbo].[Orders_Exception1];<br />
	IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Appearances_Exception1]&#8216;) AND type in (N&#8217;U'))<br />
		DROP TABLE [dbo].[Appearances_Exception1];</p>
<p>	IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Accounts_Exception2]&#8216;) AND type in (N&#8217;U'))<br />
		DROP TABLE [dbo].[Accounts_Exception2];<br />
	IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Orders_Exception2]&#8216;) AND type in (N&#8217;U'))<br />
		DROP TABLE [dbo].[Orders_Exception2];<br />
	IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N&#8217;[dbo].[Appearances_Exception2]&#8216;) AND type in (N&#8217;U'))<br />
		DROP TABLE [dbo].[Appearances_Exception2];</p>
<p>	&#8211; Create the exceptions files</p>
<p>	SELECT *<br />
	INTO Accounts_Exception1<br />
	  FROM [Accounts]<br />
	WHERE (Account_Id__c in (<br />
	SELECT Account_Id__c<br />
	FROM [Accounts]<br />
	GROUP BY Account_Id__c<br />
	  HAVING COUNT(*) > 1));</p>
<p>	DELETE FROM [Accounts]<br />
	WHERE (Account_Id__c in (<br />
	SELECT Account_Id__c<br />
	FROM [Accounts]<br />
	GROUP BY Account_Id__c<br />
	  HAVING COUNT(*) > 1));</p>
<p>	SELECT *<br />
	INTO [Orders_Exception1]<br />
	FROM [Orders]<br />
	WHERE (OrderID__c in (<br />
	SELECT OrderID__c<br />
	  FROM [Orders]<br />
	  GROUP BY OrderID__c<br />
	  HAVING COUNT(*) > 1));</p>
<p>	DELETE<br />
	FROM [Orders]<br />
	WHERE (OrderID__c in (<br />
	SELECT OrderID__c<br />
	  FROM [Orders]<br />
	  GROUP BY OrderID__c<br />
	  HAVING COUNT(*) > 1));</p>
<p>	SELECT *<br />
	INTO [Appearances_Exception1]<br />
	FROM [Appearances]<br />
	WHERE (ScheduleID__c in (<br />
	SELECT ScheduleID__c<br />
	  FROM [Appearances]<br />
	  GROUP BY ScheduleID__c<br />
	  HAVING COUNT(*) > 1));</p>
<p>	DELETE<br />
	FROM [Appearances]<br />
	WHERE (ScheduleID__c in (<br />
	SELECT ScheduleID__c<br />
	  FROM [Appearances]<br />
	  GROUP BY ScheduleID__c<br />
	  HAVING COUNT(*) > 1));</p>
<p>	SELECT a.*<br />
	INTO Orders_Exception2<br />
	FROM Orders a<br />
	LEFT JOIN Accounts o on a.Account_Id__c = o.Account_Id__c<br />
	LEFT JOIN Account opp on a.Account_Id__c = opp.Account_Id__c<br />
	WHERE ((o.Account_Id__c is null AND opp.Account_Id__c is null) OR (a.CloseDate IS NULL))<br />
		AND IsNull(opp.IsDeleted,0) = 0;</p>
<p>	CREATE NONCLUSTERED INDEX [IDX_Orders_Exception2_OrderId] ON [dbo].[Orders_Exception2]<br />
	( [OrderID__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]</p>
<p>	DELETE<br />
	FROM [Orders]<br />
	WHERE ([OrderID__c] in (SELECT [OrderID__c] FROM [Orders_Exception2]));</p>
<p>	SELECT a.*<br />
	INTO Appearances_Exception2<br />
	FROM Appearances a<br />
	LEFT JOIN Orders o on a.OrderId__c = o.OrderID__c<br />
	LEFT JOIN Opportunity opp on a.OrderId__c = opp.OrderID__c<br />
	WHERE ((o.OrderID__c is null AND opp.OrderID__c is null ) OR (a.[Date] IS NULL))<br />
		AND IsNull(opp.IsDeleted,0) = 0;</p>
<p>	CREATE NONCLUSTERED INDEX [IDX_Appearances_Exception2_ScheduleId] ON [dbo].[Appearances_Exception2]<br />
	( [ScheduleID__c] ASC )<br />
	WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]</p>
<p>	DELETE<br />
	FROM [Appearances]<br />
	WHERE (ScheduleID__c in (SELECT ScheduleID__c FROM [Appearances_Exception2]));</p>
<p>	&#8211; If a SRID was not provided, but a SalesRep name was, then look up the user by name in the users table<br />
	UPDATE Accounts<br />
	SET SLS_1__c = s.Name<br />
	FROM Accounts a inner join [User] u ON (a.SLS_1_Name__c = u.Name)<br />
		inner join SRID__c s ON (s.User__c = u.Id) AND (a.Business_Unit__c = s.Business_Unit__c)<br />
	WHERE a.SLS_1__c IS NULL;</p>
<p>	UPDATE Accounts<br />
	SET SLS_2__c = s.Name<br />
	FROM Accounts a inner join [User] u ON (a.SLS_2_Name__c = u.Name)<br />
		inner join SRID__c s ON (s.User__c = u.Id) AND (a.Business_Unit__c = s.Business_Unit__c)<br />
	WHERE a.SLS_2__c IS NULL;</p>
<p>	&#8211; If a SRID was not provided, but a SalesRep name was, then look up the user by name in the users table<br />
	UPDATE Orders<br />
	SET SLS_1__c = s.Name<br />
	FROM Orders o inner join [User] u ON (o.SLS_1_Name = u.Name)<br />
		inner join SRID__c s ON (s.User__c = u.Id) AND (o.Business_Unit__c = s.Business_Unit__c)<br />
	WHERE o.SLS_1__c IS NULL;</p>
<p>	&#8211; If we still don&#8217;t have an owner on the Account, then assign the market SRID<br />
	UPDATE Accounts<br />
	SET SLS_1__c = &#8216;M&#8217; + Business_Unit__c<br />
	WHERE (SLS_1__c IS NULL);</p>
<p>	&#8211; If no opportunity owner was specified, then try to get the owner name from the appearance or from the Account otherwise<br />
	UPDATE Orders<br />
	SET SLS_1__c = app.[REP NBR]<br />
	&#8211;SELECT o.OrderID__c,o.SLS_1__c, app.[REP NBR]<br />
	FROM Orders o INNER JOIN Appearances app ON o.OrderID__c = app.OrderId__c<br />
	INNER JOIN (<br />
		SELECT OrderId__c, Count(DISTINCT [REP NBR]) as NumReps<br />
		FROM Appearances app<br />
		GROUP BY OrderId__c<br />
		HAVING COUNT(DISTINCT [REP NBR]) = 1<br />
	) qo ON o.OrderID__c = qo.OrderId__c<br />
	WHERE o.SLS_1__c IS NULL;</p>
<p>	UPDATE Orders<br />
	SET SLS_1__c = a.SLS_1__c<br />
	FROM Accounts a inner join Orders o ON a.Account_Id__c = o.Account_Id__c<br />
	WHERE o.SLS_1__c IS NULL;</p>
<p>	&#8211; Populate AccountAgency IDs from the cached Account table<br />
	UPDATE AccountAgency<br />
	SET AccountId = b.Id, AgencyId = c.Id<br />
	FROM AccountAgency a INNER JOIN Account b ON (a.AccountNbr = b.Account_Id__c)<br />
		inner join Account c ON (a.AgencyNbr = c.Account_Id__c);</p>
<p>	DELETE FROM AccountAgency<br />
		WHERE (AccountId IS NULL) OR (AgencyId IS NULL);</p>
<p>	UPDATE AccountAgency<br />
	SET PartnerId = b.Id<br />
	FROM AccountAgency a INNER JOIN [Partner] b<br />
		ON (a.AccountId = b.AccountFromId) AND (a.AgencyId = b.AccountToId)</p>
<p>	DELETE FROM AccountAgency<br />
		WHERE (PartnerId IS NOT NULL);<br />
END</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2011/12/admarcmactive_2_2k11_12_28/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: IncContact</title>
		<link>http://www.qihost.com/myWiki/2011/12/inccontact/</link>
		<comments>http://www.qihost.com/myWiki/2011/12/inccontact/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 16:26:02 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1348</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.qihost.com/myWiki/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-1348">Password:<br />
<input name="post_password" id="pwbox-1348" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2011/12/inccontact/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mirro Technique</title>
		<link>http://www.qihost.com/myWiki/2011/12/mirro-technique/</link>
		<comments>http://www.qihost.com/myWiki/2011/12/mirro-technique/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 19:17:43 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[mirror]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1344</guid>
		<description><![CDATA[http://keys-to-success.blogspot.com/2009/10/mirror-technique-from-magic-of.html he Mirror Technique &#8211; page 107 Stand in front of a mirror that you can see yourself from the waist up. Come to attention – stand fully erect, bring your heels together, pull in your stomach, keep your chest out and your head up. Breathe deeply three to four times until you feel a [...]]]></description>
			<content:encoded><![CDATA[<p>http://keys-to-success.blogspot.com/2009/10/mirror-technique-from-magic-of.html</p>
<p>he Mirror Technique &#8211; page 107</p>
<p>Stand in front of a mirror that you can see yourself from the waist up.</p>
<p>Come to attention – stand fully erect, bring your heels together, pull in your stomach, keep your chest out and your head up.</p>
<p>Breathe deeply three to four times until you feel a sense of power, strength, and determination.<br />
Look into the very depths of your eyes.</p>
<p>Tell yourself that you are going to get what you want – name it aloud, so you can see your lips moving and you can hear the words uttered.</p>
<p>Make a regular ritual of it, practice doing it at least twice a day, mornings and evenings.</p>
<p>You can augment this by writing with soap on the face of the mirror any slogans or key words you wish, so long as they are the key to what you have previously visualized and want to see in reality. (I would also suggest using post-it notes.)</p>
<p>Here is a suggestion from Tecca in Ohio&#8230; instead of soap or post it notes&#8230;..using a wipe board marker on the mirror works wonderful and it comes off easy. I do this a lot. Plus you can use colors too.</p>
<p>“Within a few days you will have developed a sense of confidence that you never realized you could build within yourself.” Page 108</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2011/12/mirro-technique/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server BCP &#8211; put quotes around all fields</title>
		<link>http://www.qihost.com/myWiki/2011/12/sql-server-bcp-put-quotes-around-all-fields/</link>
		<comments>http://www.qihost.com/myWiki/2011/12/sql-server-bcp-put-quotes-around-all-fields/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 20:38:04 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[bcp]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[quote]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.qihost.com/myWiki/?p=1338</guid>
		<description><![CDATA[SELECT quotename(ISNULL([SRIDNode],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level1SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level1EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level1FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level2SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level2EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level2FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level3SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level3EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level3FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level4SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level4EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level4FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level5SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level5EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level5FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level6SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level6EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level6FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level7SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level7EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level7FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level8SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level8EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level8FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level9SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level9EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level9FullName],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([Level10SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level10EmpNo],&#8221;),&#8217;&#8221;&#8216;), quotename(ISNULL([TCode],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([BizTeam],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Title],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([SalesGrp],&#8221;),&#8217;&#8221;&#8216;) FROM [salesreps].[dbo].[SalesOrgHouWithGrp]]]></description>
			<content:encoded><![CDATA[<p>SELECT<br />
quotename(ISNULL([SRIDNode],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level1SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level1EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level1FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level2SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level2EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level2FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level3SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level3EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level3FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level4SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level4EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level4FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level5SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level5EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level5FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level6SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level6EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level6FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level7SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level7EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level7FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level8SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level8EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level8FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level9SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level9EmpNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level9FullName],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([Level10SalesRepNo],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Level10EmpNo],&#8221;),&#8217;&#8221;&#8216;),<br />
quotename(ISNULL([TCode],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([BizTeam],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([Title],&#8221;),&#8217;&#8221;&#8216;),quotename(ISNULL([SalesGrp],&#8221;),&#8217;&#8221;&#8216;)<br />
FROM [salesreps].[dbo].[SalesOrgHouWithGrp]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.qihost.com/myWiki/2011/12/sql-server-bcp-put-quotes-around-all-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

