Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Retrieving the query in a view

Author  Topic 

1fred
Posting Yak Master

158 Posts

Posted - 2002-06-13 : 10:25:02
HI, I am making a view named LNbCustomerV and the query in it look like that:
select count(*) from LCustomerT

Can I make a select on a system table that will return me my query. Something like this

select @query = query from sysObject where name = 'LNbCustomerV'

colinm
Yak Posting Veteran

62 Posts

Posted - 2002-06-13 : 10:40:53
Try this


select text from syscomments where id = object_id('myView')


Go to Top of Page
   

- Advertisement -