Home Microsoft SQL Server DigiMailing iRN Contact


  No additional text.

CREATE VIEW sys.table_types AS
	SELECT name,
		t.xtype AS system_type_id,
		t.id AS user_type_id,
		t.schid AS schema_id,
		own.indepid AS principal_id,
		t.length AS max_length,
		t.prec AS precision,
		t.scale AS scale,
		convert(sysname, collationpropertyfromid(t.collationid, 'name')) AS collation_name,
		sysconv(bit, 1 - (t.status & 1)) AS is_nullable,	-- TYPE_NOTNULL
		sysconv(bit, 1) AS is_user_defined,
		sysconv(bit, 0) AS is_assembly_type,
		sysconv(int, 0) AS default_object_id,
		sysconv(int, 0) AS rule_object_id,
		sysconv(bit, 1) AS is_table_type,
		o.indepid AS type_table_object_id
	FROM sys.sysscalartypes t
	LEFT JOIN sys.syssingleobjrefs own ON own.depid = t.id AND own.class = 44 AND own.depsubid = 0	-- SRC_TYPETOOWNER
	INNER JOIN sys.syssingleobjrefs o ON o.depid = t.id AND o.class = 36 AND o.depsubid = 0	
		-- 36==SRC_TYPETOTABLE, so only table types show up in this view
	WHERE has_access('UT', t.id) = 1

Last revision 2008RTM
See also

  spt_columns_odbc_view (View)
spt_datatype_info_view (View)
spt_procedure_params_view (View)
spt_table_types_view (View)
spt_table_type_columns_view (View)
spt_table_type_primary_keys_view (View)
sp_tables (Procedure)
sp_table_types (Procedure)
sp_table_types_rowset (Procedure)
sp_table_type_columns_100 (Procedure)


  Query a named instance
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
Zoekmachine optimalisatie
SQL Servers hidden objects
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
sIFR; de combinatie tussen HTML en Flash