Monday, June 8, 2009

Prism - Mozilla Labs

Prism is a new project by Mozilla labs which is capable of separating web applications from the browser and running Web Apps as separate desktop applications. In other words a Web App can be run as a desktop application and not run from within a browser. Also in some cases Prism can be used even to run Web applications offline. With Prism applications run separately from the browser, so they stay up even if the browser doesn't.

Prism is a web 2.0 application, come as a standalone application as well as a FireFox extension. It is not a new platform, but the web platform integrated with desktop experience. Therefore Web developers don't have to target Prism separately, as any application that can run in a modern standard web browser can run in it and it supports technologies like HTML, JavaScript, CSS.

Main Features of Prism
  • Access web apps from system taskbar
  • Tray icon and dock menus
  • Run applications as startup apps
  • Associate applications with browser links
  • Minimize to tray
  • Popup alerts

Both flavors of Prism can be downloaded from Mozilla Labs here.

Friday, May 22, 2009

Determine SQL Server Object Dependencies with sp_Depends and sp_ MSdependencies

The sp_Depends system stored procedure displays information about object dependencies for a table, view, stored procedure, user defined function, or trigger using the information stored in a system table named sysdepends.

Syntax:
EXEC sp_depends @objname = N'dbo.table1';

This will return both the name and type of the objects dependent on 'table1'. However sp_depends doesn't list tables, but does list check constraints.


The sp_MSdependencies can also be used to find dependent objects. In here, depending on the specified parameters the results will be varied. For example;

Syntax: EXEC sp_MSdependencies N'dbo.table1', null, 1315327



Syntax:EXEC sp_MSdependencies N'dbo.table1', null, 1053183



Syntax: EXEC sp_MSdependencies N'dbo.table2', null, 1315327



Syntax:EXEC sp_MSdependencies N'dbo.table2', null, 1053183



Syntax: EXEC sp_MSdependencies N'dbo.table1'



Syntax: EXEC sp_MSdependencies N'dbo.table2'



Syntax: EXEC sp_MSdependencies N'dbo.table3'

Wednesday, April 29, 2009

Difference between Clustered and Non-Clustered Indexes

Clustered Index: index entries are actually data records and the database table is physically sorted on the basis of that index. Therefore when the database searches for an entry, it will end up with the actual data a lot faster. There can be only one Clustered index for a table. So this is usually made on the primary key.

Clustered indexes are good for:
  • Columns that contain a large number of distinct values
  • Queries that return a range of values using operators such as BETWEEN, >, <, >=, <=
  • Columns that are accessed sequentially
  • Queries that return large result sets

Non- Clustered Index: Index entries are not actually data records and index is UNSORTED. In here logical order of the index does not match with the physical stored order of the rows on the disk. That means the index data is stored outside the table and contains a sorted reference to the table. There can be many Clustered indexes for a table.

Ex: Clustered index is like a phone directory, where actual records are sorted by name. Non- clustered index is like an 'Index' in the end of a book, where actual records are not sorted. But you have sorted references to the book content.


Note: Clustered Index is an SQL Server term and is not like an Oracle cluster, but more like an Oracle Index Organized Table (IOT).

Indexing the table makes the data retrieval faster but it has a disadvantage that the insert and update statements start to take longer as all the indexes are updated and this effect is different in the two approaches. Because in clustered index you'll have to split the pile in the middle and insert/update records. In non-clustered it is only updating sorted references.

Tuesday, March 10, 2009

NTFS File System for USB Flash Drives

Recently I came across a situation where I wanted to copy a virtual hard disk (which is about 12GB in size) to my USB drive. Though there was enough free space on the disk I wasn't able to copy the file. Reason for this was maximum file size allowed in FAT file system is 4096MB.

So I thought of formatting my flash drive with NTFS file system and just searched for pros and cons.

Pros:

  • Avoid file size restriction
  • NTFS allow file compression
  • Manage permissions for individual files and folders
  • Use windows XP built in file encryption

Cons:

  • Additional data writes – NTFS logs disk transactions separately on the disk adding considerable amount of extra disk activity, which leads to wearing out your USB drive faster
  • Windows 98/ ME, and most Linux systems cannot read NTFS partitions
  • Must go through removal dialog, or else you have a good chance of losing data as you have to switch from the 'Optimize for quick removal' mode

Therefore it is up to you to choose between formatting flash drive with NTFS or not. As I read, if you have done your research and decided to format your flash drive with NTFS, here is how to do it.

  • Right Click My Computer-> Select Manage-> Open Device Manager
  • Select your USB Drive-> Right Click-> Select Properties-> Select Policies Tab -> Select Optimize for performance option-> Click OK

  • Open My Computer-> Right Click on your USB Drive-> Select Format-> Select File System as NTFS-> Start

A good article on "Format a USB drive with NTFS file system" can be found here.

Friday, February 6, 2009

Install & Configure Microsoft Commerce Server 2007

1. Install Microsoft Commerce Server 2007 Developer Edition on a standard Visual Studio 2005 workstation with default options selected. If you don't want to develop web applications Microsoft .NET Framework 2.0 is sufficient.

Commerce Server 2007 needs several prerequisites, including .NET Framework 2.0 and IIS. If these main prerequisites are installed, you can select "Automatically install the platform prerequisites" option so that additional components like hot fixes will be downloaded and installed during the installation process.

Before you install Commerce Server, you must create several accounts to run the Commerce Server services. Refer "Create User Accounts" section in the installation guide for more information.

2. Commerce Server Configuration Wizard allows you to configure commerce server and it can be found in start menu. Once you configured commerce server, it won't allow you to configure again. In the case invoke "CSConfig.exe /f" from Commerce Server command prompt to force the new configuration.

In the configuration wizard select a DB Server to create admin DBs (EX: MSCS_Admin)

3. Unpack .pup file (site) using Commerce Server Site Packager.

This will create Commerce DBs, Web services and application virtual directory.

4. Make sure you granted all relevant permissions, so that application can connect to the DBs (Create Users/Roles in DB, Setup AppPools in IIS).

5. Assign users to commerce server web services in AzMan.

Open AzMan.msc, open AzMan store from xml files that is in each unpacked Web Service folder (Right Click the Authorization Manager node and click on Open Authorization Store). (EX: CatalogAuthorizationStore.xml)

Add your domain account to the roles you wish to manage in Azman (Ex: Go to CatalogAuthorizationStore -> CatalogandInventorySystem -> Role Assignments -> Administrator. Then right click on the roles you wish to manage and choose "Assign Windows Users or Groups").

6. Install Business User Applications on a work station.

Before installing follow these sections in the "installation Guide" to grant required permissions.

  • Assign Write Permissions to the Catalog Authorization Policy
  • Assign Write Permissions to the Temporary ASP.NET Folder
  • Assign Permissions for the Windows Temporary Folder
  • Add Users or Windows Groups to the Authorization Policy Roles
  • Add Users or Windows Groups to the Authorization Policy Roles
  • Add the Worker Process Accounts to the IIS_WPG group

7. Then Configure Catalog Manager, etc to your Web Services and you are done!!!

In case if you get "WebService was not available" error message and WebServices can be navigated through IE without any issue, the reason would be the Catalog Web Service does not have write access to the AuthorizationPolicy path.

To resolve this issue you have to assign write permissions on CatalogAuthorizationStore.xml to the account running the AppPool. (CatalogAuthorizationStore.xml file can be found in the same directory as CatalogWebService.asmx. Account running the AppPool can be found from IIS Manager.)

Hope this help someone, as configuring Commerce Server is always tricky.