I want to dynamically create a Drop/Create Script. For that I can calculate the Create part as below.
SELECT definition FROM sys.sql_modules
My Query – can you suggest something for the Drop Stored Proc Part…
I am trying a Create/Drop Script for Stored Proc
Comparisons of join vs.
OBJECTPROPERTYmethod for Pankaj:Click to enlarge:
Don’t copy and try to use the OUTPUT from the second screen shot. Why on earth would you do this? This is SQL Server’s internal representation of a parameterized version of the query. Let me paste the code so that you aren’t doing unexplainable things with what I’m trying to show you:
Run those and check the results in profiler. Am I still “wrong” Pankaj? Would you like to waste any more of everyone’s time today?