关于数据库object的问题
1.数据库的中的Views、store procedures、functions是保存在哪个表中?
2.是否可以批量修改数据库视图或存储过程的内容,例如将其views和store procedures中所有有的'prtest'的字符用'Updtest'代替,请问怎样写?
谢谢!
[解决办法]
1.数据库的中的Views、store procedures、functions是保存在哪个表中?
select name 'ObjectName',
case xtype when 'V' then 'Views'
when 'P' then 'StoreProcedures'
when 'FN' then 'Functions' end 'ObjectType'
from sys.sysobjects
where xtype in('V','P','FN')
select a.name 'ObjectName',
case a.xtype when 'V' then 'Views'
when 'P' then 'StoreProcedures'
when 'FN' then 'Functions' end 'ObjectType',
b.definition 'Script'
from sys.sysobjects a
inner join sys.sql_modules b on a.id=b.[object_id]
where a.xtype in('V','P','FN')