• samehzagloul (12/9/2010)


    The problem is that the join in the query is wrong where it joins on the xtype column of systypes it should use xusertype instead.

    [font="Courier New"]Did you try the query before you say there was a wrong in the join[/font]

    Please don't take offence, I was merely pointing out that if there are user defined datatypes in the databse then joining on the xtype column in systypes will return incorrect results (too many rows) as the xtype column is not unique in this case. You need to join on the xusertype column instead which is unique.

    If you look at the systypes table in the AdventureWorks database you will see why there is a problem.