tbayart / sql-server-data-producer

Automatically exported from code.google.com/p/sql-server-data-producer
0 stars 0 forks source link

BUG: Does not handle user defined types #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Does not handle user defined types.

Original issue reported on code.google.com by a03pe...@gmail.com on 31 Oct 2012 at 1:35

GoogleCodeExporter commented 9 years ago
Required for Milestone 1 (Release 1)

Original comment by a03pe...@gmail.com on 31 Oct 2012 at 1:40

GoogleCodeExporter commented 9 years ago
This should help to fix this issue.

SELECT 
  [column] = c.name, 
  [base type] = COALESCE(bt.name, t.name),
  [defined type] = t.name, 
  t.precision, 
  t.scale, 
  t.max_length
FROM sys.columns AS c
INNER JOIN sys.types AS t
ON c.system_type_id = t.system_type_id
AND c.user_type_id = t.user_type_id
LEFT OUTER JOIN sys.types AS bt
ON t.is_user_defined = 1
AND bt.is_user_defined = 0
AND t.system_type_id = bt.system_type_id
AND t.user_type_id <> bt.user_type_id
WHERE c.object_id = OBJECT_ID('dbo.your_table_name');

Original comment by a03pe...@gmail.com on 14 Nov 2012 at 3:38

GoogleCodeExporter commented 9 years ago

Original comment by a03pe...@gmail.com on 14 Nov 2012 at 5:52