Collection NS Database Structure
Filed under:
Notification Server
Reference
Submitted by networkchic on 30 July, 2008 - 14:44.
If you've ever wondered what a collection structure of a NS Database looked like wonder no more! Ponder this a bit...
select
[table_name] as [Table Name],
[column_name] as [Column Name],
case [data_type]
when 'varchar' then [data_type] + '(' + cast([character_maximum_length] as varchar) + ')'
when 'nvarchar' then [data_type] + '(' + cast([character_maximum_length] as nvarchar) + ')'
else [data_type]
end as [Data Type],
case [is_nullable]
when 'No' then 'No'
else 'Yes'
end as [Nullable],
isnull([column_default], '') as [Default Value],
isnull(cast([numeric_precision] as nvarchar),'') as [Precision],
isnull(cast([numeric_precision_radix] as nvarchar),'') as [Precision Radix],
isnull([collation_name],'') as [Collation Name]
from information_schema.[columns]
where [table_catalog] like '%'
and [table_schema] like 'dbo'
and [table_name] like '%'
and [column_name] like '%'
and [data_type] like '%'
order by [table_name], [ordinal_position]
(26 votes)
- Login or register to post comments
- 1564 reads
- Printer-friendly version















Recent comments
1 hour 39 min ago
2 hours 10 min ago
3 hours 1 min ago
3 hours 10 min ago
3 hours 26 min ago
3 hours 41 min ago
4 hours 21 min ago
5 hours 53 min ago
5 hours 55 min ago
5 hours 56 min ago