June 13, 2012

sp_tables_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_rowset2(nvarchar @table_schema
, nvarchar @table_type)

MetaData:

   
create procedure sys.sp_tables_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_tr.TABLE_CATALOG,
TABLE_SCHEMA = s_tr.TABLE_SCHEMA,
TABLE_NAME = s_tr.TABLE_NAME,
TABLE_TYPE = s_tr.TABLE_TYPE,
TABLE_GUID = s_tr.TABLE_GUID,
DESCRIPTION = s_tr.DESCRIPTION,
TABLE_PROPID = s_tr.TABLE_PROPID,
DATE_CREATED = s_tr.DATE_CREATED,
DATE_MODIFIED = s_tr.DATE_MODIFIED
from
sys.spt_tables_view s_tr
where
(@table_schema is null or schema_id(@table_schema) = s_tr.schema_id) and
(@table_type is null or @table_type = s_tr.TABLE_TYPE)
order by 4, 2, 3

No comments:

Post a Comment

Total Pageviews