June 13, 2012

sp_tables_info_rowset2 (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_tables_info_rowset2(nvarchar @table_schema
, nvarchar @table_type)

MetaData:

   
create procedure sys.sp_tables_info_rowset2
(
@table_schema sysname = null,
@table_type nvarchar(255) = null
)
as
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
-- copy & pasted from version 1 of the SProc and removed checks for 1st parameter !
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
select
TABLE_CATALOG = s_tiv.TABLE_CATALOG,
TABLE_SCHEMA = s_tiv.TABLE_SCHEMA,
TABLE_NAME = s_tiv.TABLE_NAME,
TABLE_TYPE = s_tiv.TABLE_TYPE,
TABLE_GUID = s_tiv.TABLE_GUID,
BOOKMARKS = s_tiv.BOOKMARKS,
BOOKMARK_TYPE = s_tiv.BOOKMARK_TYPE,
BOOKMARK_DATATYPE = convert(smallint, 19), -- DBTYPE_UI4
BOOKMARK_MAXIMUM_LENGTH = convert(int, 4),
BOOKMARK_INFORMATION = s_tiv.BOOKMARK_INFORMATION,
TABLE_VERSION = s_tiv.TABLE_VERSION,
CARDINALITY = s_tiv.CARDINALITY,
DESCRIPTION = s_tiv.DESCRIPTION,
TABLE_PROPID = s_tiv.TABLE_PROPID
from
sys.spt_tables_info_view s_tiv
where
(@table_schema is null or schema_id(@table_schema) = s_tiv.schema_id) and
(@table_type is null or @table_type = s_tiv.TABLE_TYPE)
order by 4, 2, 3

No comments:

Post a Comment

Total Pageviews