Wednesday, October 17, 2012

Microsoft SQL Server Lock table for some duration

-- Declare a I_LOCK_YOU procedure
BEGIN TRAN I_LOCK_YOU;

-- simply select any table we intend to lock.
SELECT TOP (1000) * FROM VOUCHER.TICKET TKT (HOLDLOCK) JOIN VOUCHER.TRANS TRN (HOLDLOCK) ON TRN.TKT_ID = TKT.TKT_ID
WHERE TRN.STAT_ID = 3;

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

COMMIT TRAN I_LOCK_YOU;

Tuesday, July 03, 2012

Microsoft SQL Server Command Line Tool SQLCMD

SQL Server Command Line Tool SQLCMD can be download from here:
http://www.microsoft.com/en-us/download/confirmation.aspx?id=16978

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?

Source: http://support.microsoft.com/kb/921174

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.
http://www.howtogeek.com/howto/microsoft-office/use-gmail-imap-in-microsoft-outlook-2007/
http://support.google.com/mail/bin/answer.py?hl=en&ctx=mail&answer=12103
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.
http://support.real-time.com/tbird/outlook_import.html
http://kb.mozillazine.org/Import_.pst_files

Sunday, February 12, 2012

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

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

Observation:
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.

CTM
https://www.eservices.ctm.net/cportal/base/public/mobiweb/MobiwebLeftNav.iface?pathZh=/mobiweb/tariffplans/zh/serviceplan.html


Smartone
http://www.smartone.com/mo/tc/mobile-services/price-plans/integrated-voice-and-data-plans/pricing.jsp
iphone 4S: http://iphone.smartone.com/jsp/mo/iPhone4S/tchinese/price.jsp


Three.com.mo (和記電訊,和記黃埔集團成員)
http://three.com.mo/plan/month However it doesn't show the data plan.

Visit the shop, the current promotion (12 Feb 2012), 18 months contract, early termination penalty Mop200:
帶機轉台/上台優惠
Mop63/1100分鐘,送全套增值服務(來電等待、來電顯示、電話會議、來電轉駁)

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: http://iphone.three.com.mo/tariff?type=iphone4
iphone 4S: http://iphone.three.com.mo/tariff?type=iphone4S