<?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>Michael S. Clark &#187; SQL</title>
	<atom:link href="http://www.ne0ge0.com/tags/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ne0ge0.com</link>
	<description>When I talk, the world ignores me...</description>
	<lastBuildDate>Mon, 12 Dec 2011 15:44:39 +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>Reading SQL Server Timestamp Field Using PHP</title>
		<link>http://www.ne0ge0.com/2011/11/30/reading-sql-server-timestamp-field-using-php/</link>
		<comments>http://www.ne0ge0.com/2011/11/30/reading-sql-server-timestamp-field-using-php/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 15:53:04 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ne0ge0.com/?p=597</guid>
		<description><![CDATA[I&#8217;ve been working on a project where I have to maintain data in a SQL Server database. In order to prevent different users updating the same data at the same time, I&#8217;ve also employed optimistic locking by using a &#8220;timestamp&#8221; field called OLToken on each table which is binary. This field is read out and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a project where I have to maintain data in a SQL Server database. In order to prevent different users updating the same data at the same time, I&#8217;ve also employed <a href="http://en.wikipedia.org/wiki/Optimistic_locking" target="_blank">optimistic locking</a> by using a &#8220;timestamp&#8221; field called OLToken on each table which is binary. This field is read out and is used in any Insert and Update statements to ascertain if the record has been updated since the data was read out.</p>
<p>I&#8217;m using PHP to get each record. There isn&#8217;t much on the web about working with timestamp fields in PHP, so I created the function below to convert and store the OLToken as an integer:</p>
<pre class="brush: php; title: ; notranslate">
function ConvertOLToken ($theToken)
{
   $OLToken = &quot;&quot;;
   for ($i = 0; $i &lt; strlen ($theToken); $i++)
   {
      $Byte = dechex (ord ($theToken[$i]));
      $OLToken .= str_pad ($Byte, 2, &quot;0&quot;, STR_PAD_LEFT);
   }
   return hexdec($OLToken);
}
</pre>
<p>This value is passed back to stored procedures as an integer parameter and used in stored procedures:</p>
<pre class="brush: sql; title: ; notranslate">
IF EXISTS (
   SELECT 1
   FROM [Table]
   WHERE [ID] = @pID
      AND [OLToken] = CONVERT([binary](8), @pOLToken))
BEGIN
...
END
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ne0ge0.com/2011/11/30/reading-sql-server-timestamp-field-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Text In Microsoft SQL Server Stored Procedures</title>
		<link>http://www.ne0ge0.com/2011/07/07/find-text-in-microsoft-sql-server-stored-procedures/</link>
		<comments>http://www.ne0ge0.com/2011/07/07/find-text-in-microsoft-sql-server-stored-procedures/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 09:02:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ne0ge0.com/?p=534</guid>
		<description><![CDATA[I recently had to perform a change on any stored procedures that contained a certain piece of text. Not knowing how to search for text across a database, I googled it and found the following small piece of useful code: [Via: ASP FAQ]]]></description>
			<content:encoded><![CDATA[<p>I recently had to perform a change on any stored procedures that contained a certain piece of text. Not knowing how to search for text across a database, I googled it and found the following small piece of useful code:</p>
<pre class="brush: sql; title: ; notranslate">
SELECT [ROUTINE_NAME], [ROUTINE_DEFINITION]
FROM [INFORMATION_SCHEMA].[ROUTINES]
WHERE [ROUTINE_DEFINITION] LIKE '%&amp;lt;insert_text_here&amp;gt;%'
AND [ROUTINE_TYPE] = 'PROCEDURE'
</pre>
<p>[<em>Via: <a title="ASP FAQ" href="http://databases.aspfaq.com/database/how-do-i-find-a-stored-procedure-containing-text.html">ASP FAQ</a></em>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ne0ge0.com/2011/07/07/find-text-in-microsoft-sql-server-stored-procedures/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Online Shop using AJAX</title>
		<link>http://www.ne0ge0.com/2009/07/16/online-shop-using-ajax/</link>
		<comments>http://www.ne0ge0.com/2009/07/16/online-shop-using-ajax/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 08:37:21 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Interests]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ne0ge0.com/?p=351</guid>
		<description><![CDATA[The Pro Shop that I developed at Computa Services for the Carnoustie Golf Links, is now live. It uses concurrent AJAX, calling a lightweight PHP+XML web service layer to communicate with a Microsoft SQL Server. The management application that the staff at the Links use to administer the bookings is written in C#, using C# [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="https://www.carnoustiegolflinks.co.uk/ProShop/">Pro Shop</a> that I developed at <a href="http://www.computa.co.uk">Computa Services</a> for the <a href="http://www.carnoustiegolflinks.co.uk">Carnoustie Golf Links</a>, is now live.</p>
<p>It uses concurrent AJAX, calling a lightweight PHP+XML web service layer to communicate with a Microsoft SQL Server.</p>
<p>The management application that the staff at the Links use to administer the bookings is written in C#, using C# web services back to the SQL Server.</p>
<p>Like the online booking, the AJAX layer is based on &quot;<a href="http://www.hunlock.com/blogs/The_Ultimate_Ajax_Object">The Ultimate AJAX object</a>&quot; by Patrick Hunlock, which I&#8217;ve found to be one of the only objects that elegantly supports concurrency.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ne0ge0.com/2009/07/16/online-shop-using-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tee-Time Booking Using AJAX</title>
		<link>http://www.ne0ge0.com/2008/11/15/tee-time-booking-using-ajax/</link>
		<comments>http://www.ne0ge0.com/2008/11/15/tee-time-booking-using-ajax/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 14:34:47 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Interests]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ne0ge0.com/2008/11/15/tee-time-booking-using-ajax/</guid>
		<description><![CDATA[The online tee-time booking system that I developed at Computa Services for the Carnoustie Golf Links, is now live. It uses concurrent AJAX, calling a lightweight PHP+XML web service layer to communicate with a Microsoft SQL Server. The management application that the staff at the Links use to administer the bookings is written in C#, [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="https://www.carnoustiegolflinks.co.uk/OnlineBooking/">online tee-time booking system</a> that I developed at <a href="http://www.computa.co.uk">Computa Services</a> for the <a href="http://www.carnoustiegolflinks.co.uk">Carnoustie Golf Links</a>, is now live.</p>
<p>It uses concurrent AJAX, calling a lightweight PHP+XML web service layer to communicate with a Microsoft SQL Server.</p>
<p>The management application that the staff at the Links use to administer the bookings is written in C#, using C# web services back to the SQL Server.</p>
<p>The AJAX layer is based on &quot;<a href="http://www.hunlock.com/blogs/The_Ultimate_Ajax_Object">The Ultimate AJAX object</a>&quot; by Patrick Hunlock, which I&#8217;ve found to be one of the only objects that elegantly supports concurrency.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ne0ge0.com/2008/11/15/tee-time-booking-using-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why?</title>
		<link>http://www.ne0ge0.com/2006/03/13/why/</link>
		<comments>http://www.ne0ge0.com/2006/03/13/why/#comments</comments>
		<pubDate>Mon, 13 Mar 2006 09:10:52 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://blog.ne0ge0.com/index.php/2006/03/13/why/</guid>
		<description><![CDATA[Why can&#8217;t you use GetDate() inside a Sql Server User-Defined Function?]]></description>
			<content:encoded><![CDATA[<p>Why can&#8217;t you use GetDate() inside a Sql Server User-Defined Function?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ne0ge0.com/2006/03/13/why/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

