Wednesday, August 25, 2010

How to: Avoid Last Known Good Configuration problems

Usually we developers won’t restart our developer machines or laptops regularly. Recently We had a problem with a server which ended up requiring a reboot. Unfortunately the server failed to restart properly and the only option left was to choose last known good configuration. It was reboot long time ago since then there are lots up updates installed which required reboots also. So we won’t restart regularly as possible you may end up loosing lot of changes.

So my sincere advice would be to reboot as regularly as possible, so that if you do ever have to choose last known good configuration then you don't wipe out too many changes.

Check this if I didn't really know what last known good configuration actually meant.

Tuesday, August 24, 2010

How to: Remove working folders -Visual SourceSafe

Setting a working folder for a VSS project is pretty standard practice. You set it, and you expect it to cascade down to the project's files and sub-projects.
If a sub-project has a working folder defined that differs from the cascaded one, then this takes priority for that sub-project and anything further down that branch of the tree.
Suppose you want to remove a sub-project's working folder, so it falls in line with the working folder cascaded down from the top level project. You would probably delete the path in the VSS dialog, and the working folders would then be consistent with the SourceSafe database tree.

Working folders are stored on a per user, per project, per machine basis. They are stored in the <VSSDB>\users\<user>\ folder, in a file called ss.ini.
Open this file in a text editor. In VSS, set a project's working folder and over-ride the cascading by setting a sub-project's working folder as well. Close VSS so that the changes to the ss.ini file are saved.
In the ss.ini file you'll notice some new lines at the end, looking something like this:

[$/IssueTracker/IssueTrackerUI]
Dir (PRINCE) = c:\inetpub\wwwroot\IssueTrackerUI
[$/IssueTracker/IssueTracker]
Dir (PRINCE) = D:\IssueTracker
[$/IssueTracker/IssueTracker/IssueTrackerBase]
Dir (PRINCE) = D:\IssueTracker\IssueTrackerBase
[$/IssueTracker/IssueTracker/IssueTrackerData]
Dir (PRINCE) = D:\IssueTracker\IssueTrackerData
[$/IssueTracker/IssueTracker/IssueTrackerService]
Dir (PRINCE) = D:\IssueTracker\IssueTrackerService

According to the documentation on VSS, it is possible to programatically change the working folder for a project in VSS using the LocalSpec property of the IVSSItem interface.


Rather than writing an app using the VSS API, I ended up removing the lines for the working folders I wanted to remove.


It worked for me…Good luck.

MSDN SQL Server 2008 Wiki

The Volunteer Moderators and Answerers who support the Microsoft MSDN SQL Server Forums have created a new wiki to present Solutions to Common T-SQL Problems at http://code.msdn.microsoft.com/SQLExamples.

Tuesday, August 17, 2010

TreeSize Free

Every hard disk is too small if you just wait long enough. TreeSize Free tells you where precious space has gone to.
TreeSize Free can be started from the context menu of a folder or drive and shows you the size of this folder, including its subfolders. You can expand this folder in Explorer-like style and you will see the size of every subfolder. Scanning is done in a thread, so you can already see results while TreeSize Free is working. The Explorer context menu is supported within TreeSize, as well as the usual drag & drop operations.

You can Download TreeSize Free from here. TreeSize Free is freeware for Windows 2000/XP/Vista/7.  Users of Windows 9x/ME can download the last compatible version TreeSize Free V2.1.

Supported Operating systems

  • Windows 7 (32 Bit / 64 Bit)
  • Windows Vista (32 Bit / 64 Bit)
  • Windows XP (32 Bit / 64 Bit)
  • Windows 2000
  • Windows Server 2008 (32 Bit / 64 Bit)
  • Windows Server 2003 (32 Bit / 64 Bit)

Friday, August 06, 2010

Utility: 7-Zip Format

7-Zip is the new archive format, providing high compression ratio. 7-Zip is open source software. Most of the source code is under the GNU LGPL license. The unRAR code is under a mixed license: GNU LGPL + unRAR restrictions. Check license information here: 7-Zip license.

Main Features of 7z format:

  • High compression ratio in new 7z format with LZMA compression
  • Supported formats:
    • Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR
    • Unpacking only: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z.
  • For ZIP and GZIP formats, 7-Zip provides a compression ratio that is 2-10 % better than the ratio provided by PKZip and WinZip
  • Strong AES-256 encryption in 7z and ZIP formats
  • Self-extracting capability for 7z format
  • Integration with Windows Shell
  • Powerful File Manager
  • Powerful command line version
  • Plugin for FAR Manager
  • Localizations for 74 languages

I personally like it very much. Its really helpful for me. Hope you all like this. You can Download 7-Zip for Windows.

Execute Stored Procedure with Output Parameters?

SQL Server stored procedure that you can call is one that returns one or more OUT parameters, which are parameters that the stored procedure uses to return data back to the calling application. Here is the sample procedure which i am using with output parameters.

CREATE PROCEDURE GetEmployeeRoles
   @employeeID INT,
   @Roles VARCHAR(200) OUTPUT
AS
BEGIN
   SELECT @Roles = Roles 
   FROM HumanResources.Employee 
   WHERE EmployeeID = @employeeID
END

For testing this using SQL Query Analyzer or Editor you can use below code  to see the results.

DECLARE @roles VARCHAR(200)
EXECUTE GetEmployeeRoles 6,@roles OUTPUT
SELECT @roles as EmployeeRoles

Hope this helps!

Sunday, August 01, 2010

Picasa 3.6 features

Picasa 3.6 has improved name tags, a feature based on the same technology that powers name tags on Picasa Web Albums. With name tags, you can organize your photos based on what matters most: the people in them. In this new version, you can also upload photos to your friends' collaborative albums, more easily geotag photos using Google Maps, and import photos from your camera and upload them to Picasa Web Albums in one step. Get started by downloading Picasa at http://picasa.google.com