Archive for the 'Database' Category

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 [...]

Extract, Transform and Load (ETL) - Part 2

I have been working on Data Warehousing in the Insurance Company for quite some time. Since 2001 to be exact. ETL is part of data warehouse component. My Introduction post about ETL is somewhere in 2006. Since then, so many things happened. I resign and come back again to the same company,doing the same [...]

Reveals your forgotten mdb password !

Some of my friends asking about how to reveal protected access file (.mdb) due to some reasons, hence I write this post to help them.
Here you go.
Description
===========
This utility reveals the database password of every password-protected mdb file that created with Microsoft Access 95/97/2000/XP or with Jet Database Engine 3.0/4.0 .
It can be very [...]

MS SQL - Find MAX value from varchar/nvarchar field.

Can you guess which one is a max number if the data type for the field is not an integer ? perhaps it is varchar or nvarchar field.

10
1
2
3
14
15
9
8

The answer is 9. I believe it is because ascii value for 9 = 57 and the ascii value for 25 = 50

Then, how you want to get [...]


AWSOM Powered