Wednesday, October 17, 2012

Microsoft SQL Server Lock table for some duration

-- Declare a I_LOCK_YOU procedure

-- simply select any table we intend to lock.

-- You can sleep as long as you like.
WAITFOR DELAY '00:00:04';


Tuesday, July 03, 2012

Microsoft SQL Server Command Line Tool SQLCMD

SQL Server Command Line Tool SQLCMD can be download from here:

1. In the above website, search for "Native Client" --> Microsoft® SQL Server® 2008 R2 Native Client

2. In the above website, search for "sqlcmd" --> Microsoft® SQL Server® 2008 R2 Command Line Utilities

The SQLCMD utility allows users to connect to, send Transact-SQL batches from, and output rowset information from SQL Server 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008 and 2008 R2 instances. The bcp utility bulk copies data between an instance of Microsoft SQL Server 2008 R2 and a data file in a user-specified format. The bcp utility can be used to import large numbers of new rows into SQL Server tables or to export data out of tables into data files.
Note: This component requires both Windows Installer 4.5 and Microsoft SQL Server Native Client

Install items 1 and 2.

SQLCMD.exe can be found here: C:/Program Files/Microsoft SQL Server/100/Tools/Binn/SQLCMD.EXE

Thursday, May 17, 2012

Office Word 2007 single double line spacing

Ask: The default setting creates double spacing between lines. How do I have the default be single spacing?


To do this, follow these steps:

1. Click the Home tab.

2. Click Change Styles in the Styles group, point to Style Set, and then click the style set that you want to use.

To change the default formatting of your document, such as the line spacing and paragraph spacing, to the default formatting that is used in earlier versions of Word, click Word 2003.

3. To set the style set as the default style set in Word 2007, click Change Styles in the Styles group, and then click Set as Default.

Tuesday, February 14, 2012

Backup Outlook Email PST file

Microsoft Outlook Email storage .pst file is a proprietary format. Surprisingly no other email client can import the pst file itself right away. 2 best way I found to backup Microsoft Outlook Email stores in .pst file.

Both methods require Microsoft Outlook installed locally on the PC.

(A) Backup Outlook email to GMail.
1. Setup Gmail IMAP inside Outlook.
2. Transfer email from Outlook to Gmail. It takes long time to move email 1 by 1. But once it is done, you realize all the emails with related topic are threaded together in Gmail way. And it is very easy to search your email inside GMail.

(B) Backup Outlook to email Thunderbird.

Sunday, February 12, 2012

Macau mobile plan comparison 比较澳门流动电话套餐

Task: Trying to look for mobile plan + data usage.

Pay-per-use data usage charges expensively with low data flow, e.g. 1-2G free per month only, extra usage MopP0.02/KB till Mop500 maximum. Unlimited data usage charges Mop318/Mop418(with new phone) per month.


iphone 4S: (和記電訊,和記黃埔集團成員) However it doesn't show the data plan.

Visit the shop, the current promotion (12 Feb 2012), 18 months contract, early termination penalty Mop200:

Auto incremental data usage:
Mop23, 200MB
Mop48, 400MB
Mop68, 1G
Mop88, 2GMop188, unlimited data

Meaning, if user uses 300MB that month, the bill falls into Mop48; if user uses 500MB, the bill falls into Mop68, automatically. Even if user uses more than 2G, the maximum bill is Mop188.

iphone 4:
iphone 4S: