Tuesday, September 16, 2008

Bug Shooting Tool for Screen Capture

Based on recommendation from Amit Agarwal of the Digital Inspiration blogger, I found this utility awesome - http://www.bugshooting.com/web/

Tuesday, February 5, 2008

Last Modified / Created When - DB Objects

I run into this issue very often when the code is getting moved from development to staging to production environments. Most of us work in a multiple development resource environment and this is an issue because the changes gets made and sometimes it is easy for resources to forget to tell what got changed and when. This is where SQL 2005's sys.objects rocks.

1) The following query will tell you exactly which stored procedure or user table got modified say in the last 3 days.

SELECT name
FROM sys.objects
WHERE type in ('P', 'U')
AND DATEDIFF(D,modify_date, GETDATE()) < 3 -- 3 is a changeable value.

2)The following query will tell you exactly which stored procedure or user table got created say in the last 3 days.

SELECT name
FROM sys.objects
WHERE type in ('P', 'U')
AND DATEDIFF(D,create_date, GETDATE()) < 3 -- 3 is a changeable value.

I have a customer who has parameterized the value 3 in terms of hours because they have development resources in 3 different countries and they want to Police the coding standards.

Source - SQL Authorty, Pinal Dave

Sunday, February 3, 2008

Finally a really free PDF Editor

I have searched for many years for a free PDF editor. Remember, Adobe Reader is to only read PDF documents and not to edit one. You will need to have a licensed copy of Adobe to edit PDF. This will change when Sun releases OpenOffice 3.

I use OpenOffice quite frequently in my personal laptop and can vouch it is awesome!

SQL Server Maintenance tips from SQL Anuthority.

I am regular reader of an awesome blog by Pinal Dave. He recently published top 10 tips for SQL Server maintenance tips for SAP. Although the tips by Takayuki Hoshino is for SAP, I think these tips are fantastic regardless of the ERP. I know I will recommend this to all my clients going forward. Tip # 8 to update statistics on your large table is something I got burnt at one of my implementations recently. Seems so simple, but easy to forget!!

Tuesday, January 1, 2008

Delete files from the network based on file path and date/time parameters.

Delete files from the network based on file path and date/time parameters.

This script came in handy when I was trying to delete some old XML documents from the network. The best part about this script was we were able to schedule to execute this script from windows scheduler. I created this script with the help of Michael Scott.

'*******************************************************************************************
' Created BY : Srinivasan Prasanna
' Company : Company ABC
' Date : 09/05/2007
' Logic : This script is run as a batch program to remove the files from the
' selected folder
' : This script was created with the help of an internet resource - Michael
' Scott
'*************************************************************************************


Dim fso, fldr, fc, f1 'fldname, usrname, srcFile
set FSO = Wscript.CreateObject("scripting.FileSystemObject")
fldname = "D:\HJS\DCA\Peoplesoft89\XML\Export" '<---- change to top directory Const DateofFile = -30 '<----- age of deleted files
DeleteFiles = FSO.GetFolder(fldname)
Set fldr = fso.GetFolder(fldname)

Recurse fldr

Set fldr = Nothing
Set fso = Nothing
wscript.echo "Files Deleted Successfully"
Wscript.Quit

Public Sub Recurse( ByRef fldr)
dim subfolders,files,folder,file
Dim srcFile
Set subfolders = fldr.SubFolders
Set files = fldr.Files

For Each srcfile in files
If DateDiff("d", Now, srcFile.DateLastModified) &lt; DateofFile Then
FSO.DeleteFile srcFile, True
End If

Next

'************** Recurse all of the subfolders.

For Each folder in subfolders
Recurse folder
Next

'************** Deletes empty folders

if (fldr.files.count = 0) and (fldr.subfolders.count) = 0 then
on error resume next
fldr.delete
exit sub
end if

End Sub

You can also download this script from the google document site