General SQL scripts --->选all views 和all stored procedures
use 库名; go SELECT OBJECT_NAME(sm.object_id) AS object_name, o.type, o.type_desc, sm.definition FROM sys.sql_modules AS sm JOIN sys.objects AS o ON sm.object_id = o.object_id where o.type in ('V','P');
go
SELECT OBJECT_NAME(sm.object_id) AS object_name,
o.type,
o.type_desc,
sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
where o.type in ('V','P');