Friday, August 19, 2011

MSSQL : Need To Update the Date of your records??

Ever had a situation where your terminal had an incorrect date/time  - which causes the entries from that terminal to have wrong date stored inside your DB?


Well, here's an example of the script to update those records. In the example, I only need to update the day of the date. I need to change only the day of those dates to 18th.


declare @startID as Integer --beginning record ID in your list to update
declare @endID as Integer   --last recordID in your list to update
declare @currID as Integer --id as counter
declare @tempD as DateTime --temporary date
declare @dateString as varchar(50) --new Date to be update in String format.


Set @startID = 16883
Set @endID = 16897
Set @currID = @startID


while (@currID <= (@endID) )
BEGIN
select @tempD=thedate from tbl_x where record_id= @currID
PRINT @currID
PRINT @tempD
--construct the Date String (Ammend this to whatever format of date you prefer
Set @dateString = cast(datepart(yy,@tempD) as varchar) + '-' + cast(datepart(mm,@tempD) as varchar)  + '-' + '18' + ' ' + cast(datepart(hh,@tempD) as varchar) + ':' + cast(datepart(mi,@tempD) as varchar) + ':' + cast(datepart(ss,@tempD) as varchar)  
PRINT @dateString
--Update your table
update tbl_x set tbl_thedate=@dateString where record_id= @currID
Set @currID = @currID + 1 
END
GO

Monday, August 8, 2011

Office 2007 Annoying message : "This document is both encrypted and password protected. Do you want to increase the security"...? Disable it now



If you assigned password for your spreadsheet file, and that file was created using earlier version of Microsoft Office(earlier than 2007), you may receive this pop-up notification every time you try to save that file.


How to Disable it now using Windows Registry Editor(REGEDIT).


1. Get Admin access.
2. Go To "Start>Run>". Type in "regedit" and press enter.
3. Browse through the registry for the below key.

     [HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Security]
     "NoPromptForRC4Encryption"=dword:00000001


4. If the key does not exist, just create it according to the path above.
5. Exit Registry, restart PC, and try to save the same document again.
6. Be Happy ! :)

Sunday, July 31, 2011

Android : Advanced Task Killer (ATK)

When working with smart phones, response time and battery consumption are always a concern. You always look forward to close as much unused apps to conserve processing - which will improve your battery life and response time.

One thing about Android that I dun quite like is there's no something like 'close program' button for ALL apps. (Some apps actually do have- like PAPAGO). So, at a certain point of time, we may not know what apps is actually still running. Well, here's where Task killer apps comes in handy.

Advanced Task Killer(ATK) so far works for my Sony XPeria X8. :) You can spot on any currently running apps in background and choose to close them or otherwise.

You can download it from the web or get it from the Android Market:
http://download.cnet.com/Advanced-Task-Killer-Free-for-Android/3000-18512_4-75011529.html

Android Rulez!!..