THANKS RALS,
the query that you posted will make effect through EXECUTE but the EXECUTE statement that is post in the today's QOD is not making any effect it will always print 'Master' database
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/