what will be the effect if uniqueidentifier data type column is clustered/Non Clustered index in a table sql server 2005/2008. I read it is badly designed table, how to avoidy this problem and what is the best solution?
If it is non-clustered, it just means the index will be wide (16 bytes per row, rather than 4 bytes per row with an integer).
If it is clustered, then insertions will lead to page splits, depending on how much free space (Fill Factor) you leave in the index when you create/rebuild it.
There are a few questions on SO discussing this topic:
Should I get rid of clustered indexes on Guid columns
Advantages and disadvantages of GUID / UUID database keys
Clustered primary key on unique identifier ID column in SQL Server
GUID is a bad choice for clustered index in SQL Server, since due to its randomness of values, the clustered index gets badly fragmented.
Also, since the clustered index field(s) are replicated into each of the non-clustered indices, it can also lead to significant waste of disk and memory space in SQL Server.
GUID is a great choice from a programmer's perspective - more or less random, almost guaranteed to be unique - but from a database perspective, using them as clustered index in SQL Server is very bad choice.
See Kim Tripp's various articles on this - very englihtnening!
http://www.sqlskills.com/BLOGS/KIMBERLY/post/GUIDs-as-PRIMARY-KEYs-andor-the-clustering-key.aspx
http://sqlskills.com/BLOGS/KIMBERLY/post/The-Clustered-Index-Debate-Continues.aspx
Marc