View: Temp_Columns_View
View definition
`CREATE VIEW cdal.Temp_Columns_View AS SELECT C.object_id AS object_id , C.name AS COLUMN_NAME , C.column_id - 1 AS COLUMN_INDEX , T.name AS TYPE_NAME , C.is_identity AS IS_AUTO_NUM , C.is_computed AS IS_COMPUTED , C.is_nullable AS IS_NULLABLE , CONVERT(BIT, CASE WHEN C.default_object_id <> 0 THEN 1 ELSE 0 END) AS HAS_DEFAULT , CONVERT(INT, CASE WHEN C.max_length = -1 THEN -1 WHEN T.name IN ( 'ntext' ) THEN 1073741823 WHEN T.name IN ( 'text', 'image' ) THEN 2147483647 WHEN T.name IN ( 'nchar', 'nvarchar' ) THEN C.max_length / 2 WHEN T.name IN ( 'char', 'varchar', 'varbinary', 'timestamp', 'uniqueidentifier' ) THEN C.max_length ELSE C.precision END) AS COLUMN_PRECISION , CONVERT(INT, C.scale) COLUMN_SCALE , C.collation_name AS COLUMN_COLLATION FROM tempdb.sys.columns AS C WITH ( NOLOCK ) INNER JOIN tempdb.sys.types AS T WITH ( NOLOCK ) ON C.system_type_id = T.system_type_id AND T.system_type_id = T.user_type_id;`