看了一下sp_helptext的内容得到的。
触发器:
select text from sysobjects t,syscomments m where type='TR' and m.id=t.id and t.name=触发器的名字
存储过程:
select text from sysobjects t,syscomments m where type='P' and m.id=t.id and t.name=存储过程的名字
视图:
select text from sysobjects t,syscomments m where type='V' and m.id=t.id and t.name=视图的名字
视图:
select text from sysobjects t,syscomments m where type='V' and m.id=t.id and t.name=视图的名字