Archive for July, 2008

AutoIT - Connecting to SQL Server.

Playing around with AutoIt take me to next level of coding. This time I need to automate a process where in a normal situation it will involve a few people to make the whole process completed.
One of the process need a connection to MS-SQL ,execute query and and get the results. As sharing is [...]

MSSQL - ORDER BY with a specific words

In SQL,the only option for Order by is either using Ascending or Descending. Sometimes,these two option is not possible to order the item based on your needs.
For example,let say you have a data like below and want to order by Type - Open then Close then Suspended.

Problem [...]

SQL Injection Attack using T-SQL and HEXADECIMAL

SQL Injection occurs when an attacker is able to insert a series of SQL statements into a ‘query’ by manipulating data input into an application. This can be either using a web form or URL query string.
Last week, I found the sample of real case where the attacker used T-SQL combining with HEX values to [...]

Masa terlalu pantas berlalu….

Salam jumaat.
Sabtu lepas aku dikejutkan lagi dengan berita kematian. Kali ini giliran jiran aku pulak yg pergi dulu di usia awal 40an meninggalkan seorang isteri dan seorang anak yang masih kecil.
Teringat pula kisah hidup arwah one of my friend,Zul Rushdi yang juga meninggal di awal 40an.Al-fatihah utk beliau…Al-fatihah juga untuk arwah ayah,arwah-arwah muslimin [...]

MS-SQL : CHARINDEX Vs PATINDEX

CHARINDEX and PATINDEX functions return the starting position of a pattern you specify. PATINDEX can use wildcard characters while CHARINDEX cannot.
Imagine you have a BoxNo field with below values in your table.
BoxNo
——
BOX1
BOX3
BOX4
BOX30
BOX123
Using MS-SQL syntax,You will have a few options to separate those values into number.
1.)
select BoxNo,substring(BoxNo,CHARINDEX(’X’,BoxNo)+1,len(BoxNo)) as No from #temp
2.)
select BoxNo,replace(BoxNo,’BOX’,”) as No from #temp
You [...]


AWSOM Powered