Linson.Daniel (11/1/2009)Then again....would someone tell me why would I go about generating scripts like the way that was shown here when SQL server itself provides all the necessary options to script your db objects?

For instance, when I want to see the definition of all objects that reference a particular linked server, or call a certain stored proc, or use OPENQUERY, or whatever else I'm interested in. I usually use something like "SELECT definition FROM [?].sys.sql_modules WHERE definition LIKE '%xyz%' " as a parameter for sp_msforeachdb.