select type, COUNT(type) as cnt from sys.sysobjects where type not in ('S','K','D','F','IT','SQ','')
group by type
--U -- table objects
select * from sys.sysobjects where type = 'U'
--V -- View objects
select * from sys.sysobjects where type = 'V'
--P -- Stored procedures
select * from sys.sysobjects where type = 'P'
--TF,FN -- Functions (Table Valued, Scalar Valued)
select * from sys.sysobjects where type IN ('TF','FN')
--TR -- Trigger objects
select * from sys.sysobjects where type = 'TR'
To get the object scripts,
(Except table objects)
EXEC sp_helptext 'schemaname.Tablename'
The result will be returned in multiple lines.
group by type
--U -- table objects
select * from sys.sysobjects where type = 'U'
--V -- View objects
select * from sys.sysobjects where type = 'V'
--P -- Stored procedures
select * from sys.sysobjects where type = 'P'
--TF,FN -- Functions (Table Valued, Scalar Valued)
select * from sys.sysobjects where type IN ('TF','FN')
--TR -- Trigger objects
select * from sys.sysobjects where type = 'TR'
To get the object scripts,
(Except table objects)
EXEC sp_helptext 'schemaname.Tablename'
The result will be returned in multiple lines.
No comments:
Post a Comment