Skip to main content
9 events
when toggle format what by license comment
Jan 24, 2012 at 12:40 comment added Peter Thats true the Compatibility level is set to 80.
Jan 24, 2012 at 12:37 comment added Martin Smith @Petoj If you can only run it in the master database then maybe the compatibility level of your user databases is lower. The join on sys.objects will end up excluding queries that belong to other databases.
Jan 24, 2012 at 10:55 comment added Oleg Dok The code definitely works - I use it every almost day
Jan 24, 2012 at 10:42 vote accept Peter
Jan 24, 2012 at 10:42 comment added Peter Im not sure what this query does but i get no results from it, i can only run it in my master database else i get a "Incorrect syntax" even if i remove the "where s2.dbid = db_id()" i still get no results, but any way thanks you answered my question!
Jan 24, 2012 at 10:30 comment added Oleg Dok See updated answer. And addition - sql server keeps the compiled query text - say me, what it should compile in EXEC someproc? 8-)
Jan 24, 2012 at 10:27 comment added Peter Thanks for the fast reply, but why is the t.TEXT QueryName "create procedure ..." and not "exec ..."? thats gives me the headache..
Jan 24, 2012 at 10:27 history edited Oleg Dok CC BY-SA 3.0
added 2138 characters in body
Jan 24, 2012 at 10:21 history answered Oleg Dok CC BY-SA 3.0