I am seeking to run a query to modify views across multiple databases (See the initial question here.) and was able to find how to get it. I've now run into the problem that if I run this from master (Where I'm sure it has to run from) i receive null results. However, if i go to a specific database and run the dynamic query there, i get the views i'm looking to modify (the intended result).
This is the action I want performed on each database:
select @strResult = definition from sys.sql_modules where object_id = object_id('view')
What do i need to do to ensure that I get this information back?